From ef8c2c576043330a7a22d9549284003e57c284bb Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Fri, 1 Mar 2024 13:55:25 +0200 Subject: Add possibility to manage own vote --- templates/poll.html.j2 | 23 ++++++++++++++++------- templates/poll_vote_list.html.j2 | 23 ++++++++++++++++++++--- templates/poll_vote_table.html.j2 | 19 ++++++++++++++++--- 3 files changed, 52 insertions(+), 13 deletions(-) (limited to 'templates') diff --git a/templates/poll.html.j2 b/templates/poll.html.j2 index e0ede1f..1661b79 100644 --- a/templates/poll.html.j2 +++ b/templates/poll.html.j2 @@ -21,14 +21,23 @@ -
- {% if display_mode == "table" %} - {% include "poll_vote_table.html.j2" %} - {% else %} - {% include "poll_vote_list.html.j2" %} - {% endif %} -
+ +{% if display_mode == "table" %} +{% include "poll_vote_table.html.j2" %} +{% else %} +{% include "poll_vote_list.html.j2" %} {% endif %} + +{% endif %} {% endblock %} diff --git a/templates/poll_vote_list.html.j2 b/templates/poll_vote_list.html.j2 index 9d3a15c..ef09af4 100644 --- a/templates/poll_vote_list.html.j2 +++ b/templates/poll_vote_list.html.j2 @@ -23,8 +23,25 @@
- - - +
+ + + +
+{% if managed_voter_names | length != 0 %} +
+
+

Remove submission(s)

+{% endif %} +
+ {% for voter_name in managed_voter_names %} +
+ + {{ voter_name }} + +
+ {% endfor %} +
\ No newline at end of file diff --git a/templates/poll_vote_table.html.j2 b/templates/poll_vote_table.html.j2 index a7aa434..440f2b7 100644 --- a/templates/poll_vote_table.html.j2 +++ b/templates/poll_vote_table.html.j2 @@ -12,7 +12,17 @@ {% for voter_name in voter_names %} - {{ voter_name }} + + {% if voter_name in managed_voter_names %} +
+ + {{ voter_name }} + +
+ {% else %} + {{ voter_name }} + {% endif %} + {% for choice in choices %} {% if selections[(voter_name, choice.id)] == 1 %} @@ -32,10 +42,13 @@ {% endfor %} +
- + + {% for choice in choices %} @@ -43,7 +56,7 @@ {% endfor %} +
- -- cgit v1.3