{% block subtitle %}Administrer les votes{% endblock %}
{% block body %}
<div class="row">
- <hr />
+ <a class="pull-right btn btn-primary btn-small" href="{{ url_for('admin_vote_add') }}">+ Nouveau vote</a>
{% if not votes %}
<div class="alert">Il n'y a aucun vote.</div>
{% else %}
<tr>
<td>{{ vote.title }}</td>
<td>{% if vote.is_terminated %}<span class="label label-success">Terminé</span>{% else %}{% if vote.is_open %}<span class="label label-info">Ouvert</span>{% else %}<span class="label label-important">Fermé</span>{% endif %}{% endif %}</td>
- <td>{{ vote.date_end }}</td>
+ <td><span {% if vote.date_end < today %}style="color: red;"{% endif %}>{{ vote.date_end }}</span></td>
<td>{{ vote.groupname }}</td>
<td>{{ vote.category }}</td>
<td>
{% if vote.is_transparent %}<span class="label">transparent</span>{% endif %}
+ {% if vote.is_anonymous %}<span class="label">anonymous</span>{% endif %}
{% if vote.is_public %}<span class="label">public</span>{% endif %}
- {% if vote.is_multiplechoice %}<span class="label">choix multiple</span>{% endif %}
</td>
<td>
<a href="{{ url_for('vote', idvote=vote.voteid) }}" class="btn btn-success btn-mini">Voir</a>
<a href="{{ url_for('admin_vote_edit', voteid=vote.voteid) }}" class="btn btn-mini">Éditer</a>
+ <a href="#delete{{ vote.voteid }}" data-toggle="modal" class="btn btn-mini btn-danger">Supprimer</a>
</td>
</tr>
+ <div class="modal hide fade" id="delete{{ vote.voteid }}">
+ <div class="modal-header">
+ <button type="button" class="close" data-dismiss="modal">×</button>
+ <h3>Suppression d'uun vote</h3>
+ </div>
+ <div class="modal-body">
+ <p>Voulez-vous vraiment supprimer le vote <strong>{{ vote.title }}</strong> ?</p>
+ </div>
+ <div class="modal-footer">
+ <a href="{{ url_for('admin_vote_del', idvote=vote.voteid) }}" class="btn btn-danger">Confirmer</a>
+ <a href="#" class="btn" data-dismiss="modal">Annuler</a>
+ </div>
+ </div>
{% endfor %}
</tbody>
</table>
+ <a class="pull-right btn btn-primary btn-small" href="{{ url_for('admin_vote_add') }}">+ Nouveau vote</a>
<p>
<strong>Légende :</strong>
<ul class="unstyled">
- <li><span class="label">transparent</span> : Les utilisateurs peuvent voir les votes des autres</li>
+ <li><span class="label">transparent</span> : Les votants peuvent voir les votes des autres</li>
+ <li><span class="label">anonymous</span> : Les suffrages du vote sont déliés de l’identité de leur votant</li>
<li><span class="label">public</span> : Tout le monde peut voir le vote</li>
- <li><span class="label">choix multiple</span> : Les utilisateurs peuvent effectuer plusieurs choix</li>
</ul>
</p>
{% endif %}
+</div>
{% endblock %}