Guillaume Subiron 13 years ago
parent
commit
136c353bf4
3 changed files with 9 additions and 3 deletions
  1. 1 0
      main.py
  2. 5 2
      templates/vote.html
  3. 3 1
      templates/votes.html

+ 1 - 0
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'))

+ 5 - 2
templates/vote.html

@@ -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 %}
@@ -92,14 +92,17 @@
   <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>
 

+ 3 - 1
templates/votes.html

@@ -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 %}