Nb votes and max votes displayed in progress bar
[cavote.git] / templates / votes.html
index e52b94b..ef54cbb 100644 (file)
@@ -6,10 +6,20 @@ Liste des votes
   {% for vote in votes %}
   <div>
     <div class="row well">
-      <div class="span4">
+      <div class="span5">
         <h3><a href="{{ url_for('vote', idvote=vote.voteid) }}">{{ vote.title }}</a></h3>
-        <div class="progress progress-striped {% if vote.nb_votes == vote.max_votes %}progress-success{% endif %}">
-          <div class="bar" style="width: {{ vote.percent }}%;"></div>
+        <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>
+            {% 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">