From 325014aeef226babb81869665d2f15da3289f30d Mon Sep 17 00:00:00 2001 From: Tom Hubrecht Date: Mon, 12 Apr 2021 03:07:31 +0200 Subject: [PATCH] =?UTF-8?q?On=20rajoute=20la=20confirmation=20pour=20les?= =?UTF-8?q?=20votes=20class=C3=A9s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- elections/templates/elections/vote.html | 51 ++++++++++++++++++++++++- elections/views.py | 1 + 2 files changed, 51 insertions(+), 1 deletion(-) diff --git a/elections/templates/elections/vote.html b/elections/templates/elections/vote.html index 6c19ca2..4dabe0e 100644 --- a/elections/templates/elections/vote.html +++ b/elections/templates/elections/vote.html @@ -11,7 +11,7 @@ var selected_rows = ''; - (document.querySelectorAll('.checkbox input') || []).forEach(($checkbox) => { + (document.querySelectorAll('.checkbox input') || []).forEach($checkbox => { if ($checkbox.checked) { let option_text = $checkbox.nextSibling.textContent.trim(); selected_rows += '' + option_text + '\n'; @@ -35,6 +35,55 @@ {% elif question.vote_type == 'rank' %} {% endif %} {% endblock %} diff --git a/elections/views.py b/elections/views.py index aff3b25..17940b4 100644 --- a/elections/views.py +++ b/elections/views.py @@ -476,6 +476,7 @@ class VoteView(OpenElectionOnlyMixin, DetailView): context["q_index"] = questions.index(self.object) + 1 context["q_total"] = len(questions) context["vote_rule"] = VOTE_RULES[self.object.type] + context["nb_options"] = self.object.options.count() return context def get_object(self):