From 5c64529e77f150f8b83930f17e792b2cb8e38a87 Mon Sep 17 00:00:00 2001 From: Jan Tuomi Date: Thu, 29 Feb 2024 21:10:43 +0200 Subject: Add whole day mode, various improvements --- templates/index.html.j2 | 21 +-------- templates/manage.html.j2 | 70 ++++++++++++++++------------ templates/poll_choice_datetime_range.html.j2 | 24 ++++++++++ templates/poll_info_table.html.j2 | 24 ++++++++++ templates/poll_vote_list.html.j2 | 21 +-------- templates/poll_vote_table.html.j2 | 20 +------- 6 files changed, 92 insertions(+), 88 deletions(-) create mode 100644 templates/poll_choice_datetime_range.html.j2 create mode 100644 templates/poll_info_table.html.j2 (limited to 'templates') diff --git a/templates/index.html.j2 b/templates/index.html.j2 index f84b428..db458da 100644 --- a/templates/index.html.j2 +++ b/templates/index.html.j2 @@ -3,26 +3,7 @@ {% block content %}

Create new diddle

- - - - - - - - - - - - - - - - - - - -
+ {% include "poll_info_table.html.j2" %}

You can add options after submitting.

diff --git a/templates/manage.html.j2 b/templates/manage.html.j2 index 55a14bd..4a5da8d 100644 --- a/templates/manage.html.j2 +++ b/templates/manage.html.j2 @@ -14,27 +14,8 @@

- - - - - - - - - - - - - - - - - - - -
-
+ {% include "poll_info_table.html.j2" %} +

@@ -55,11 +36,17 @@
- - @@ -71,10 +58,10 @@ - + - + @@ -94,7 +81,9 @@ diff --git a/templates/poll_choice_datetime_range.html.j2 b/templates/poll_choice_datetime_range.html.j2 new file mode 100644 index 0000000..ddfa970 --- /dev/null +++ b/templates/poll_choice_datetime_range.html.j2 @@ -0,0 +1,24 @@ + +{{ choice.start_datetime.strftime("%a %d.%m") }} + + + {% if now.year != choice.start_datetime.year %}.{{choice.start_datetime.year}}{% endif %} + + + {% if not poll.is_whole_day %}{{ choice.start_datetime.strftime("%H:%M") }}{% endif %} + +{% if (poll.is_whole_day and not choice.ends_on_same_day()) or (not poll.is_whole_day and not choice.ends_at_same_datetime()) %} + +{% endif %} + +{% if not choice.ends_on_same_day() %} + + {{ choice.end_datetime.strftime("%a %d.%m") }} + + + {% if now.year != choice.end_datetime.year %}.{{choice.end_datetime.year}}{% endif %} + +{% endif %} + + {% if not poll.is_whole_day %}{{ choice.end_datetime.strftime("%H:%M") }}{% endif %} + diff --git a/templates/poll_info_table.html.j2 b/templates/poll_info_table.html.j2 new file mode 100644 index 0000000..7955ca8 --- /dev/null +++ b/templates/poll_info_table.html.j2 @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/templates/poll_vote_list.html.j2 b/templates/poll_vote_list.html.j2 index c18b3e0..845356b 100644 --- a/templates/poll_vote_list.html.j2 +++ b/templates/poll_vote_list.html.j2 @@ -4,26 +4,7 @@