modify to range voting
[cavote.git] / templates / votes.html
index 55ab248..7b01e67 100644 (file)
@@ -4,27 +4,34 @@ Liste des votes
 {% endblock %}
 {% block body %}
   {% for vote in votes %}
-  <article>
+  <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">
-          <div class="bar" style="width: 60{{ vote.percent }}%;"></div>
+        <div class="row">
+          <div class="span4">
+            <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>
+          </div>
         </div>
       </div>
       <div class="span3">
-        <h4>Deadline : {{ vote.date_end }} </h4>
-        <h4>Groupe : {{ vote.group }}</h4>
+        <h4>Échéance : {{ vote.date_end }} </h4>
+        <h4>Groupe : {{ vote.groupname }}</h4>
         <h4>Categorie : {{ vote.category }}</h4>
       </div>
       <div class="span3">
-      <h4>Notes</h4>
+      {% if vote.description %}
+      <h4>Description</h4>
       <p>
-      {{ vote.description|safe }}
+      {{ vote.description }}
       </p>
+      {% endif %}
     </div>
-  </article>
+  </div>
   {% else %}
-  <div class="alert">Il n'y a pas encore de votes. Désolé.</div>
+  <div class="alert">Il n'y a pas encore de vote. Désolé.</div>
   {% endfor %}
 {% endblock %}