From ba98c3be841b0188f970753e18f16000af49ef03 Mon Sep 17 00:00:00 2001 From: trotFunky Date: Fri, 26 Jul 2024 17:55:39 +0100 Subject: [PATCH] index: Remove the form if all votes were cast Currently, if all votes are cast and the week is locked the selections are disabled but the form and button still exist and might cause confusion. Remove them if all votes are cast and we are not on the last week anymore. --- templates/index.html.tera | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/templates/index.html.tera b/templates/index.html.tera index c2f3afa..d6edfa3 100644 --- a/templates/index.html.tera +++ b/templates/index.html.tera @@ -36,6 +36,9 @@ {% set next_arrow_chara = '⟹' %} {% endif %} +{# Remove the form if all votes are locked, to reduce confusion. #} +{% set lock_truth_form = user.votes | length + 1 == truths | length and week_data.is_last_week != true %} +

{{ title }}

@@ -76,7 +79,7 @@ {% endif %}
- {% if user.logged_in == true and user.is_admin == false %} + {% if user.logged_in == true and user.is_admin == false and not lock_truth_form %}
{% endif %} @@ -101,7 +104,7 @@ {% endif %} {% endfor %} - {% if user.logged_in == true and user.is_admin == false %} + {% if user.logged_in == true and user.is_admin == false and not lock_truth_form %}