diff --git a/elections/templates/elections/election_voters.html b/elections/templates/elections/election_voters.html index 9a9fc94..6078013 100644 --- a/elections/templates/elections/election_voters.html +++ b/elections/templates/elections/election_voters.html @@ -2,6 +2,27 @@ {% load i18n %} +{% block extra_head %} + + +{% endblock %} + {% block content %}
@@ -48,6 +69,10 @@
+ {% if can_delete %} + {% include "forms/modal-form.html" with modal_id="delete" form=d_form %} + {% endif %} + @@ -85,19 +110,18 @@ {% if can_delete %} {% endfor %} {% endif %}
- {% url 'election.delete-vote' election.pk v.pk forloop.counter as post_url %} - {% blocktrans with v_name=v.full_name asvar modal_title %}Supprimer le vote de {{ v_name }}{% endblocktrans %} - + {% blocktrans with v_name=v.full_name asvar v_delete %}Supprimer le vote de {{ v_name }}{% endblocktrans %} + - {% include "forms/modal-form.html" with modal_id=forloop.counter form=v.form %} {% endif %}
+
diff --git a/elections/views.py b/elections/views.py index 69a8d74..76e781c 100644 --- a/elections/views.py +++ b/elections/views.py @@ -479,9 +479,7 @@ class ElectionVotersView(NotArchivedMixin, DetailView): and not election.tallied ) if can_delete: - # On rajoute le formulaire pour supprimer le vote - for v in voters: - v.form = DeleteVoteForm() + context["d_form"] = DeleteVoteForm() context["can_delete"] = can_delete context["voters"] = voters diff --git a/shared/templates/forms/select.html b/shared/templates/forms/select.html index 72ddae7..6f660ac 100644 --- a/shared/templates/forms/select.html +++ b/shared/templates/forms/select.html @@ -4,8 +4,8 @@ {{ field.label_tag }} -
- +
+ {{ field }}