Display current season guess state
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s
This commit is contained in:
@ -24,9 +24,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{# Simple driver select for forms #}
|
||||
{% macro driver_select(name, label, include_none, drivers=none, disabled=false) %}
|
||||
{% macro driver_select(name, label, include_none, drivers=none, disabled=false, border="") %}
|
||||
<div class="form-floating">
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select {{ border }}" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<option value="" selected disabled hidden></option>
|
||||
|
||||
{% if drivers == none %}
|
||||
@ -42,9 +42,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{# Driver select for forms where a value might be preselected #}
|
||||
{% macro driver_select_with_preselect(driver_match, name, label, include_none, drivers=none, disabled=false) %}
|
||||
{% macro driver_select_with_preselect(driver_match, name, label, include_none, drivers=none, disabled=false, border="") %}
|
||||
<div class="form-floating">
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select {{ border }}" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
{# Use namespace wrapper to persist scope between loop iterations #}
|
||||
{% set user_has_chosen = namespace(driverpre=false) %}
|
||||
|
||||
@ -75,9 +75,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{# Simple team select for forms #}
|
||||
{% macro team_select(name, label, include_none, teams=none, disabled=false) %}
|
||||
{% macro team_select(name, label, include_none, teams=none, disabled=false, border="") %}
|
||||
<div class="form-floating">
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select {{ border }}" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<option value="" selected disabled hidden></option>
|
||||
|
||||
{% if teams == none %}
|
||||
@ -93,9 +93,9 @@
|
||||
{% endmacro %}
|
||||
|
||||
{# Team select for forms where a value might be preselected #}
|
||||
{% macro team_select_with_preselect(team_match, name, label, include_none, teams=none, disabled=false) %}
|
||||
{% macro team_select_with_preselect(team_match, name, label, include_none, teams=none, disabled=false, border="") %}
|
||||
<div class="form-floating">
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
<select name="{{ name }}" id="{{ name }}" class="form-select {{ border }}" aria-label="{{ name }}" {% if disabled %}disabled="disabled"{% endif %}>
|
||||
{# Use namespace wrapper to persist scope between loop iterations #}
|
||||
{% set user_has_chosen = namespace(teampre=false) %}
|
||||
|
||||
|
@ -79,7 +79,7 @@
|
||||
<input type="checkbox" class="form-check-input" value="{{ driver.name }}"
|
||||
id="first-dnf-{{ driver.name }}" name="first-dnf-drivers"
|
||||
{% if (model.active_result is not none) and (driver in model.active_result.initial_dnf) %}checked{% endif %}
|
||||
{% if race_result_open == false %}disabled="disabled"{% endif %}>
|
||||
{% if race_result_open == false %}readonly="readonly"{% endif %}>
|
||||
<label for="first-dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">1. DNF</label>
|
||||
</div>
|
||||
@ -89,7 +89,7 @@
|
||||
<input type="checkbox" class="form-check-input" value="{{ driver.name }}"
|
||||
id="dnf-{{ driver.name }}" name="dnf-drivers"
|
||||
{% if (model.active_result is not none) and (driver in model.active_result.all_dnfs) %}checked{% endif %}
|
||||
{% if race_result_open == false %}disabled="disabled"{% endif %}>
|
||||
{% if race_result_open == false %}readonly="readonly"{% endif %}>
|
||||
<label for="dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">DNF</label>
|
||||
</div>
|
||||
@ -99,7 +99,7 @@
|
||||
<input type="checkbox" class="form-check-input" value="{{ driver.name }}"
|
||||
id="exclude-{{ driver.name }}" name="excluded-drivers"
|
||||
{% if (model.active_result is not none) and (driver in model.active_result.standing_exclusions) %}checked{% endif %}
|
||||
{% if race_result_open == false %}disabled="disabled"{% endif %}>
|
||||
{% if race_result_open == false %}readonly="readonly"{% endif %}>
|
||||
<label for="exclude-{{ driver.name }}"
|
||||
class="form-check-label text-muted" data-bs-toggle="tooltip"
|
||||
title="Driver is not counted for standing">NC</label>
|
||||
|
@ -129,7 +129,7 @@
|
||||
{# Delete guess #}
|
||||
<form action="{{ action_delete_href }}" method="post">
|
||||
<input type="submit" class="btn btn-dark mt-2 w-100" value="Delete"
|
||||
{% if race_guess_open == false %}disabled{% endif %}>
|
||||
{% if race_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
|
@ -38,9 +38,11 @@
|
||||
|
||||
{# Hot Take #}
|
||||
<div class="form-floating">
|
||||
<textarea class="form-control" id="hot-take-input-{{ user.name }}" name="hottakeselect"
|
||||
style="height: 150px"
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
<textarea
|
||||
class="form-control {% if points.hot_take_correct(user.name) %}border-success{% endif %}"
|
||||
id="hot-take-input-{{ user.name }}" name="hottakeselect"
|
||||
style="height: 150px"
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
{%- if user_guess is not none -%}{{ user_guess.hot_take_string() }}{%- endif -%}
|
||||
</textarea>
|
||||
|
||||
@ -49,20 +51,31 @@
|
||||
|
||||
{# P2 Constructor #}
|
||||
<div class="mt-2">
|
||||
{{ team_select_with_preselect(team_match=user_guess.p2_wcc, name="p2select", label="P2 in WCC:", include_none=false, disabled=not season_guess_open) }}
|
||||
{{ team_select_with_preselect(team_match=user_guess.p2_wcc, name="p2select", label="P2 in WCC:",
|
||||
include_none=false, disabled=not season_guess_open,
|
||||
border=("border-success" if points.p2_constructor_correct(user.name) else "")) }}
|
||||
</div>
|
||||
|
||||
{# Most Overtakes + DNFs #}
|
||||
<div class="input-group mt-2">
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_overtakes, name="overtakeselect", label="Most overtakes:", include_none=false, disabled=not season_guess_open) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_dnfs, name="dnfselect", label="Most DNFs:", include_none=false, disabled=not season_guess_open) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_overtakes, name="overtakeselect",
|
||||
label="Most overtakes:", include_none=false, disabled=not season_guess_open,
|
||||
border=("border-success" if points.overtakes_correct(user.name) else "")) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_dnfs, name="dnfselect", label="Most DNFs:",
|
||||
include_none=false, disabled=not season_guess_open,
|
||||
border=("border-success" if points.dnfs_correct(user.name) else "")) }}
|
||||
</div>
|
||||
|
||||
{# Most Gained + Lost #}
|
||||
<div class="input-group mt-2" data-bs-toggle="tooltip"
|
||||
title="Which driver will gain/lose the most places in comparison to last season's results?">
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_wdc_gained, name="gainedselect", label="Most WDC places gained:", include_none=false, drivers=model.drivers_for_wdc_gained(), disabled=not season_guess_open) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_wdc_lost, name="lostselect", label="Most WDC places lost:", include_none=false, disabled=not season_guess_open) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_wdc_gained, name="gainedselect",
|
||||
label="Most WDC places gained:", include_none=false, drivers=model.drivers_for_wdc_gained(),
|
||||
disabled=not season_guess_open,
|
||||
border=("border-success" if points.most_gained_correct(user.name) else "")) }}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.most_wdc_lost, name="lostselect",
|
||||
label="Most WDC places lost:", include_none=false, disabled=not season_guess_open,
|
||||
border=("border-success" if points.most_lost_correct(user.name) else "")) }}
|
||||
</div>
|
||||
|
||||
{# Team-internal Winners #}
|
||||
@ -82,7 +95,7 @@
|
||||
value="{{ driver_a.name }}"
|
||||
{% if (user_guess is not none) and (driver_a in user_guess.team_winners) %}checked="checked"{% endif %}
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
<label class="form-check-label"
|
||||
<label class="form-check-label {% if (user_guess is not none) and (driver_a in user_guess.team_winners) and points.is_team_winner(driver_a) %}text-success{% endif %}"
|
||||
for="teamwinner-{{ team.name }}-1-{{ user.name }}">{{ driver_a.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -95,7 +108,7 @@
|
||||
value="{{ driver_b.name }}"
|
||||
{% if (user_guess is not none) and (driver_b in user_guess.team_winners) %}checked="checked"{% endif %}
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
<label class="form-check-label"
|
||||
<label class="form-check-label {% if (user_guess is not none) and (driver_b in user_guess.team_winners) and points.is_team_winner(driver_b) %}text-success{% endif %}"
|
||||
for="teamwinner-{{ team.name }}-2-{{ user.name }}">{{ driver_b.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -118,7 +131,7 @@
|
||||
value="{{ driver_a.name }}"
|
||||
{% if (user_guess is not none) and (driver_a in user_guess.podiums) %}checked="checked"{% endif %}
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
<label class="form-check-label"
|
||||
<label class="form-check-label {% if (user_guess is not none) and (driver_a in user_guess.podiums) and points.has_podium(driver_a) %}text-success{% endif %}"
|
||||
for="podium-{{ driver_a.name }}-{{ user.name }}">{{ driver_a.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -131,7 +144,7 @@
|
||||
value="{{ driver_b.name }}"
|
||||
{% if (user_guess is not none) and (driver_b in user_guess.podiums) %}checked="checked"{% endif %}
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
<label class="form-check-label"
|
||||
<label class="form-check-label {% if (user_guess is not none) and (driver_b in user_guess.podiums) and points.has_podium(driver_b) %}text-success{% endif %}"
|
||||
for="podium-{{ driver_b.name }}-{{ user.name }}">{{ driver_b.name }}</label>
|
||||
</div>
|
||||
</div>
|
||||
@ -139,7 +152,7 @@
|
||||
</div>
|
||||
|
||||
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
|
||||
{% if season_guess_open == false %}disabled{% endif %}>
|
||||
{% if season_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
|
Reference in New Issue
Block a user