Dispay
authorGuillaume Subiron <maethor@subiron.org>
Wed, 6 Jun 2012 20:18:47 +0000 (22:18 +0200)
committerJulien Rabier <taziden@flexiden.org>
Thu, 7 Jun 2012 17:34:31 +0000 (19:34 +0200)
main.py
templates/vote.html
templates/votes.html

diff --git a/main.py b/main.py
index 46653b3..3effbb2 100755 (executable)
--- a/main.py
+++ b/main.py
@@ -421,6 +421,7 @@ def vote(idvote):
             else:
                 vote['nb_votes'] = tmp['nb']
                 vote['percent'] = int((float(vote['nb_votes']) / float(vote['max_votes'])) * 100)
+        # :TODO:maethor:120606: Flash if user is concerned by the vote
         return render_template('vote.html', vote=vote, attachments=attachments, choices=choices, users=users.values(), can_vote=can_vote(idvote, get_userid()))
     flash(u'Vous n\'avez pas le droit de voir ce vote, désolé.')
     return redirect(url_for('home'))
index c787420..70067a7 100644 (file)
@@ -2,7 +2,7 @@
 {% block body %}
 <div class="row">
 <div class="span9">
-<h2 class='page-header'>{{ vote.title }}</h2>
+  <h2 class='page-header'>{{ vote.title }}</h2> 
 {% if not vote.is_transparent %}
 <div class="alert alert-info">Ce sondage n'est pas transparent, vous ne pouvez pas voir les votes des autres.</div>
 {% endif %}
   <dt>Catégorie <dd><code>{{ vote.category }}</code>
 </dl>
 <dl>
+  {% if vote.description %}
   <dt>Description : <dd>{{ vote.description }}
+  {% endif %}
+  {% if attachments %}
   <dt>Documents :<dd>
   <ul>
     {% for attachment in attachments %}
     <li><a href="{{ attachment.url }}">{{ attachment.url }}</a></li>
     {% endfor %}
   </ul>
-  </li>
+  {% endif %}
 </dl>
 </div>
 
index ef54cbb..0cb1b51 100644 (file)
@@ -28,10 +28,12 @@ Liste des votes
         <h4>Categorie : {{ vote.category }}</h4>
       </div>
       <div class="span3">
-      <h4>Notes</h4>
+      {% if vote.description %}
+      <h4>Description</h4>
       <p>
       {{ vote.description|safe }}
       </p>
+      {% endif %}
     </div>
   </div>
   {% else %}