Rajoute un lien vers la liste des votant·e·s depuis la page d'admin si l'élection n'est pas dépouillée

This commit is contained in:
Tom Hubrecht 2021-03-31 13:35:25 +02:00
parent a7a029d1a2
commit 6f98654766
3 changed files with 13 additions and 2 deletions

View file

@ -57,8 +57,16 @@
{% elif election.end_date < current_time %} {% elif election.end_date < current_time %}
{# Dépouillement #}
{% if not election.tallied %} {% if not election.tallied %}
{# Liste des votants #}
<a class="dropdown-item" href="{% url 'election.voters' election.pk %}">
<span class="icon">
<i class="fas fa-list"></i>
</span>
<span>{% trans "Liste des votant·e·s" %}</span>
</a>
{# Dépouillement #}
<a class="dropdown-item" href="{% url 'election.tally' election.pk %}"> <a class="dropdown-item" href="{% url 'election.tally' election.pk %}">
<span class="icon"> <span class="icon">
<i class="fas fa-poll-h"></i> <i class="fas fa-poll-h"></i>

View file

@ -18,7 +18,7 @@
<div class="level-right"> <div class="level-right">
<div class="level-item"> <div class="level-item">
<a class="button is-primary" href="{% url 'election.view' election.pk %}"> <a class="button is-primary" href="{% url return_pattern election.pk %}">
<span class="icon is-small"> <span class="icon is-small">
<i class="fas fa-undo-alt"></i> <i class="fas fa-undo-alt"></i>
</span> </span>

View file

@ -435,6 +435,9 @@ class ElectionVotersView(NotArchivedMixin, DetailView):
and election.end_date < timezone.now() and election.end_date < timezone.now()
and not election.tallied and not election.tallied
) )
context["return_pattern"] = (
"election." + "admin" if context["can_delete"] else "view"
)
return context return context