fix when choices are added after some votes
[cavote.git] / templates / vote.html
index 5d1e4c6..f86aaf9 100644 (file)
     <tr>
       <th>{% if 'user' in session and user.userid == session.user.id %}<i class="icon-user"></i>{% endif %} {{ user.username }}</th>
       {% for choice in choices %}
+      {% if choice.id in user.choices %}
       <td class="{{user.choices[choice.id].class}}"><span>{{ user.choices[choice.id].name }}</span></td>
+      {% else %}
+      <td class="choice-after-vote"><span>Choix postérieur au suffrage</span></td>
+      {% endif %}
       {% endfor %}
       {% if 'user' in session and (can_vote or (not vote['is_terminated'] and not vote['is_anonymous'])) %}
       <td class="ok">{% if user.userid == session.user.id %}