Hide some elements if no guess remains
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 32s
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 32s
This commit is contained in:
@ -14,6 +14,7 @@ db.init_app(app)
|
|||||||
# TODO
|
# TODO
|
||||||
# General
|
# General
|
||||||
|
|
||||||
|
# - Sanitize URLs
|
||||||
# - A lot of validation (esp. in the model), each input should be checked...
|
# - A lot of validation (esp. in the model), each input should be checked...
|
||||||
|
|
||||||
# - Show cards of previous race results, like with season guesses?
|
# - Show cards of previous race results, like with season guesses?
|
||||||
|
|||||||
@ -20,17 +20,21 @@
|
|||||||
aria-expanded="false">
|
aria-expanded="false">
|
||||||
{% if active_result is not none %}
|
{% if active_result is not none %}
|
||||||
{{ active_result.race.name }}
|
{{ active_result.race.name }}
|
||||||
{% else %}
|
{% elif current_race is not none %}
|
||||||
{{ current_race.name }}
|
{{ current_race.name }}
|
||||||
|
{% else %}
|
||||||
|
{{ model.all_race_results()[0].race.name }}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu">
|
<ul class="dropdown-menu">
|
||||||
<li>
|
{% if model.first_race_without_result() is not none %}
|
||||||
<a class="dropdown-item" href="/result/{{ current_race.name }}">{{ current_race.name }}</a>
|
<li>
|
||||||
</li>
|
<a class="dropdown-item" href="/result/{{ current_race.name }}">{{ current_race.name }}</a>
|
||||||
<li>
|
</li>
|
||||||
<hr class="dropdown-divider">
|
<li>
|
||||||
</li>
|
<hr class="dropdown-divider">
|
||||||
|
</li>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% for result in model.all_race_results() %}
|
{% for result in model.all_race_results() %}
|
||||||
<li>
|
<li>
|
||||||
@ -51,11 +55,21 @@
|
|||||||
<div class="card shadow-sm" style="width: 450px;">
|
<div class="card shadow-sm" style="width: 450px;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
|
||||||
<h5 class="card-title">{% if active_result is not none %}{{ active_result.race.name }}{% else %}
|
<h5 class="card-title">
|
||||||
{{ current_race.name }}{% endif %}</h5>
|
{% if active_result is not none %}
|
||||||
|
{{ active_result.race.name }}
|
||||||
|
{% elif current_race is not none %}
|
||||||
|
{{ current_race.name }}
|
||||||
|
{% else %}
|
||||||
|
{{ model.all_race_results()[0].race.name }}
|
||||||
|
{% endif %}
|
||||||
|
</h5>
|
||||||
|
|
||||||
<form action="/result-enter/
|
<form action="/result-enter/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
{%- if active_result is not none %}{{ active_result.race.name }}{% else %}{{ current_race.name }}{% endif %}"
|
{%- if active_result is not none %}{{ active_result.race.name }}{% else %}{{ current_race.name }}{% endif %}"
|
||||||
method="post">
|
method="post">
|
||||||
<ul id="columns" class="list-group list-group-flush">
|
<ul id="columns" class="list-group list-group-flush">
|
||||||
|
|||||||
@ -73,8 +73,8 @@
|
|||||||
|
|
||||||
{% set current_race = model.first_race_without_result() %}
|
{% set current_race = model.first_race_without_result() %}
|
||||||
|
|
||||||
{# Current Result, only displayed for all users overview #}
|
{# Current Result, only displayed for all users overview and if guess is remaining #}
|
||||||
{% if active_user is none %}
|
{% if (active_user is none) and (model.first_race_without_result() is not none) %}
|
||||||
|
|
||||||
<tr class="table-danger">
|
<tr class="table-danger">
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
@ -106,8 +106,8 @@
|
|||||||
</tr>
|
</tr>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{# Enter Guess, only displayed for single user focused view #}
|
{# Enter Guess, only displayed for single user focused view and if guess is remaining #}
|
||||||
{% if active_user is not none %}
|
{% if (active_user is not none) and (model.first_race_without_result() is not none) %}
|
||||||
<tr class="table-danger">
|
<tr class="table-danger">
|
||||||
<td class="text-nowrap">
|
<td class="text-nowrap">
|
||||||
<span class="fw-bold">{{ current_race.number }}:</span> {{ current_race.name }}<br>
|
<span class="fw-bold">{{ current_race.number }}:</span> {{ current_race.name }}<br>
|
||||||
|
|||||||
Reference in New Issue
Block a user