modify to range voting
[cavote.git] / templates / votes.html
index ddb3ce0..7b01e67 100644 (file)
@@ -10,20 +10,15 @@ Liste des votes
         <h3><a href="{{ url_for('vote', idvote=vote.voteid) }}">{{ vote.title }}</a></h3>
         <div class="row">
           <div class="span4">
-            {% if vote.nb_votes == 0 %}
-            <div class="progress progress-striped progress-danger">
-              <div class="bar" style="width: 100%;"><strong>{{ vote.nb_votes }} / {{ vote.max_votes }}</strong></div>
+            <div class="progress progress-striped progress-{% if  vote.nb_votes > 0 and vote.nb_votes / vote.max_votes >= vote.quorum %}success{% else %}danger{% endif %}">
+              <div class="bar" style="width: {{ vote.percent }}%;">
+                <strong>{{ vote.nb_votes }} vote{{ 's' if vote.nb_votes > 1 else '' }} / {{ vote.max_votes }} ({{ vote.percent }}%)</strong></div>
             </div>
-            {% else %}
-            <div class="progress progress-striped {% if vote.nb_votes == vote.max_votes %}progress-success{% endif %}">
-              <div class="bar" style="width: {{ vote.percent }}%;"><strong>{{ vote.nb_votes }} / {{ vote.max_votes }}</strong></div>
-            </div>
-            {% endif %}
           </div>
         </div>
       </div>
       <div class="span3">
-        <h4>Deadline : {{ vote.date_end }} </h4>
+        <h4>Échéance : {{ vote.date_end }} </h4>
         <h4>Groupe : {{ vote.groupname }}</h4>
         <h4>Categorie : {{ vote.category }}</h4>
       </div>