From f33710a32cf361a3e89364a0f1ad6a2051b229af Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Thu, 18 Mar 2021 21:12:50 +0100 Subject: [PATCH] =?UTF-8?q?Indique=20pour=20quelles=20question=20le=20vote?= =?UTF-8?q?=20est=20enregistr=C3=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- elections/templates/elections/election.html | 6 +++++- elections/views.py | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/elections/templates/elections/election.html b/elections/templates/elections/election.html index d5931a8..2d880c0 100644 --- a/elections/templates/elections/election.html +++ b/elections/templates/elections/election.html @@ -88,7 +88,7 @@
{% if can_vote and election.start_date < current_time and election.end_date > current_time %} - + @@ -96,6 +96,10 @@ {% endif %} {{ q.text }} + + {% if q in cast_questions %} + {% trans "A voté" %} + {% endif %}
{# Liste des options possibles #} diff --git a/elections/views.py b/elections/views.py index b04c7ed..e5a6880 100644 --- a/elections/views.py +++ b/elections/views.py @@ -353,6 +353,7 @@ class ElectionView(DetailView): context["can_vote"] = user.is_authenticated and user.can_vote( self.request, context["election"] ) + context["cast_questions"] = user.cast_questions.all() return context def get_queryset(self):