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.
This commit is contained in:
parent
4e1b13dc85
commit
ba98c3be84
1 changed files with 5 additions and 2 deletions
|
@ -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 %}
|
||||
|
||||
<body>
|
||||
<div class="top_bar">
|
||||
<h1>{{ title }}</h1>
|
||||
|
@ -76,7 +79,7 @@
|
|||
</form>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% 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 %}
|
||||
<form id="truths" action="/{{ week_data.number }}/vote" method="POST">
|
||||
{% 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 %}
|
||||
<br/>
|
||||
<button form="truths">
|
||||
{%- if user.logged_in == true and user.has_week_vote == true -%}
|
||||
|
|
Loading…
Add table
Reference in a new issue