diff --git a/elections/staticdefs.py b/elections/staticdefs.py index 73a4bcf..c643a93 100644 --- a/elections/staticdefs.py +++ b/elections/staticdefs.py @@ -21,3 +21,11 @@ CONNECTION_METHODS = { QUESTION_TYPES = [ ("assentiment", _("Assentiment")), ] + +VOTE_RULES = { + "assentiment": _( + "Le mode de scrutin pour cette question est un vote par assentiment. " + "Vous pouvez donc sélectionner autant d'options que vous souhaitez. " + "Vous pouvez également ne sélectionner aucune option." + ) +} diff --git a/elections/templates/elections/vote.html b/elections/templates/elections/vote.html index ccf89a6..02a2d00 100644 --- a/elections/templates/elections/vote.html +++ b/elections/templates/elections/vote.html @@ -8,6 +8,12 @@

{% trans "Vote pour la question :" %} {{ question.text }} ({{ q_index }}/{{ q_total }})


+
+

+ {{ vote_rule|safe }} +

+
+
diff --git a/elections/views.py b/elections/views.py index f37fa70..cfad80a 100644 --- a/elections/views.py +++ b/elections/views.py @@ -26,7 +26,7 @@ from .forms import ( ) from .mixins import CreatorOnlyEditMixin, CreatorOnlyMixin, OpenElectionOnlyMixin from .models import Election, Option, Question -from .staticdefs import MAIL_VOTERS, QUESTION_TYPES +from .staticdefs import MAIL_VOTERS, QUESTION_TYPES, VOTE_RULES from .utils import create_users, send_mail # TODO: access control *everywhere* @@ -396,6 +396,7 @@ class VoteView(OpenElectionOnlyMixin, DetailView): questions = list(self.object.election.questions.all()) context["q_index"] = questions.index(self.object) + 1 context["q_total"] = len(questions) + context["vote_rule"] = VOTE_RULES[self.object.type] return context def get_object(self):