Many frontend improvements
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:
@ -7,36 +7,51 @@
|
||||
{% block body %}
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
Note
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Leaderboard</h5>
|
||||
<h6 class="card-subtitle">Points only include race picks</h6>
|
||||
Points only include race picks.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered table-sm table-responsive mt-3">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">User</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Total picks</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;" data-bs-toggle="tooltip" title="Any points count as correct">Correct picks</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points per pick</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<div class="card mt-2">
|
||||
<div class="card-header">
|
||||
Leaderboard
|
||||
</div>
|
||||
|
||||
<tbody>
|
||||
{% for user in points.users_sorted_by_points() %}
|
||||
{% set user_standing = points.user_standing()[user.name] %}
|
||||
<tr class="{% if user_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ user_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ user.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.total_points_by(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.picks_count(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.picks_with_points_count(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ "%0.2f" % points.points_per_pick(user.name) }}</td>
|
||||
<div class="card-body">
|
||||
<div class="d-inline-block overflow-x-scroll w-100">
|
||||
<table class="table table-bordered table-sm table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">User</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Total picks</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;" data-bs-toggle="tooltip"
|
||||
title="Any points count as correct">Correct picks
|
||||
</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points per pick</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for user in points.users_sorted_by_points() %}
|
||||
{% set user_standing = points.user_standing()[user.name] %}
|
||||
<tr class="{% if user_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ user_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ user.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.total_points_by(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.picks_count(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.picks_with_points_count(user.name) }}</td>
|
||||
<td class="text-center text-nowrap">{{ "%0.2f" % points.points_per_pick(user.name) }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -14,184 +14,191 @@
|
||||
|
||||
{% block body %}
|
||||
|
||||
<table class="table table-bordered table-sm table-responsive shadow-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2" class="text-center" style="width: 125px;">Race</th>
|
||||
{# Put table in this div to make right padding work #}
|
||||
<div class="d-inline-block overflow-x-scroll w-100">
|
||||
<table class="table table-bordered table-sm table-responsive shadow-sm">
|
||||
|
||||
<th scope="col" {% if model.active_user is none %}colspan="{{ model.all_users() | length }}"{% endif %}
|
||||
class="text-center">Call
|
||||
</th>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" rowspan="2" class="text-center" style="width: 125px;">Race</th>
|
||||
|
||||
<th scope="col" rowspan="2" class="text-center" style="width: 125px;">Result</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<th scope="col" {% if model.active_user is none %}colspan="{{ model.all_users() | length }}"{% endif %}
|
||||
class="text-center">Call
|
||||
</th>
|
||||
|
||||
<tbody>
|
||||
<th scope="col" rowspan="2" class="text-center" style="width: 125px;">Result</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
{# Users List #}
|
||||
<tr>
|
||||
<td> </td>
|
||||
<tbody>
|
||||
|
||||
{# Link should only be visible if all users are visible #}
|
||||
{% if model.active_user is not none %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">{{ model.active_user.name }} ({{ points.total_points_by(model.active_user.name) }})</td>
|
||||
{% else %}
|
||||
{% for user in model.all_users() %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">
|
||||
<a href="/race/{{ user.name_sanitized }}" class="link-dark">{{ user.name }} ({{ points.total_points_by(user.name) }})</a>
|
||||
{# Users List #}
|
||||
<tr>
|
||||
<td> </td>
|
||||
|
||||
{# Link should only be visible if all users are visible #}
|
||||
{% if model.active_user is not none %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">{{ model.active_user.name }}
|
||||
({{ points.total_points_by(model.active_user.name) }})
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% endif %}
|
||||
|
||||
<td> </td>
|
||||
</tr>
|
||||
|
||||
{# Current Result, only displayed for all users overview and if guess is remaining #}
|
||||
{% if (model.active_user is none) and (model.current_race is not none) %}
|
||||
|
||||
<tr class="table-danger">
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ model.current_race.number }}:</span> {{ model.current_race.name }}<br>
|
||||
<small><span class="fw-bold">Guess:</span> P{{ model.current_race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ model.current_race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
{% if model.all_users() | length > 0 %}
|
||||
{% else %}
|
||||
{% for user in model.all_users() %}
|
||||
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=model.current_race.name) %}
|
||||
|
||||
<td class="text-center text-nowrap">
|
||||
{% if user_guess is not none %}
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item" style="background-color: inherit;">
|
||||
{{ user_guess.pxx_guess.abbr }}
|
||||
</li>
|
||||
<li class="list-group-item" style="background-color: inherit;">
|
||||
{{ user_guess.dnf_guess.abbr }}
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
<td class="text-center text-nowrap" style="min-width: 100px;">
|
||||
<a href="/race/{{ user.name_sanitized }}" class="link-dark">{{ user.name }}
|
||||
({{ points.total_points_by(user.name) }})</a>
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
|
||||
{# Race countdown #}
|
||||
<span id="race_date" hidden="hidden">{{ model.current_race.date.strftime("%Y-%m-%dT%H:%M") }}</span>
|
||||
<td class="text-center text-nowrap align-middle">
|
||||
<span class="fw-bold">Race starts in:</span><br>
|
||||
<span id="race_date_countdown">00d 00h 00m 00s</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{# Enter Guess, only displayed for single user focused view and if guess is remaining #}
|
||||
{% if (model.active_user is not none) and (model.current_race is not none) %}
|
||||
<tr class="table-danger">
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ model.current_race.number }}:</span> {{ model.current_race.name }}<br>
|
||||
<small><span class="fw-bold">Guess:</span> P{{ model.current_race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ model.current_race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{% set race_guess_open = model.race_guess_open(model.current_race) %}
|
||||
{% if race_guess_open == true %}
|
||||
{% set action_save_href = "/race-guess/" ~ model.current_race.name_sanitized ~ "/" ~ model.active_user.name_sanitized %}
|
||||
{% set action_delete_href = "/race-guess-delete/" ~ model.current_race.name_sanitized ~ "/" ~ model.active_user.name_sanitized %}
|
||||
{% else %}
|
||||
{% set action_save_href = "" %}
|
||||
{% set action_delete_href = "" %}
|
||||
{% endif %}
|
||||
|
||||
{# Enter + Save guess #}
|
||||
<form action="{{ action_save_href }}" method="post">
|
||||
{% set user_guess = model.race_guesses_by(user_name=model.active_user.name, race_name=model.current_race.name) %}
|
||||
|
||||
{# Driver PXX Select #}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.pxx_guess, name="pxxselect", label="P" ~ model.current_race.place_to_guess ~ ":", include_none=true, disabled=not race_guess_open) }}
|
||||
|
||||
<div class="mt-2"></div>
|
||||
|
||||
{# Driver DNF Select #}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.dnf_guess, name="dnfselect", label="DNF:", include_none=true, disabled=not race_guess_open) }}
|
||||
|
||||
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
|
||||
{% if race_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
</form>
|
||||
|
||||
{# 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="disabled"{% endif %}>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{# Past Race Results #}
|
||||
{% for past_result in model.all_race_results() %}
|
||||
<tr>
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ past_result.race.number }}:</span> {{ past_result.race.name }}<br>
|
||||
<small><span class="fw-bold">Guessed:</span> P{{ past_result.race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ past_result.race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
{# Current Result, only displayed for all users overview and if guess is remaining #}
|
||||
{% if (model.active_user is none) and (model.current_race is not none) %}
|
||||
|
||||
{% if model.all_users_or_active_user() | length > 0 %}
|
||||
{% for user in model.all_users_or_active_user() %}
|
||||
<td class="text-center text-nowrap">
|
||||
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=past_result.race.name) %}
|
||||
<tr class="table-danger">
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ model.current_race.number }}:</span> {{ model.current_race.name }}<br>
|
||||
<small><span class="fw-bold">Guess:</span> P{{ model.current_race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ model.current_race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
{% if user_guess is not none %}
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item {{ pxx_guess_colorization(guessed_driver=user_guess.pxx_guess, result=past_result) }}">
|
||||
{% if model.all_users() | length > 0 %}
|
||||
{% for user in model.all_users() %}
|
||||
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=model.current_race.name) %}
|
||||
|
||||
<td class="text-center text-nowrap">
|
||||
{% if user_guess is not none %}
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item" style="background-color: inherit;">
|
||||
{{ user_guess.pxx_guess.abbr }}
|
||||
</li>
|
||||
<li class="list-group-item" style="background-color: inherit;">
|
||||
{{ user_guess.dnf_guess.abbr }}
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
|
||||
{# Race countdown #}
|
||||
<span id="race_date" hidden="hidden">{{ model.current_race.date.strftime("%Y-%m-%dT%H:%M") }}</span>
|
||||
<td class="text-center text-nowrap align-middle">
|
||||
<span class="fw-bold">Race starts in:</span><br>
|
||||
<span id="race_date_countdown">00d 00h 00m 00s</span>
|
||||
</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{# Enter Guess, only displayed for single user focused view and if guess is remaining #}
|
||||
{% if (model.active_user is not none) and (model.current_race is not none) %}
|
||||
<tr class="table-danger">
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ model.current_race.number }}:</span> {{ model.current_race.name }}<br>
|
||||
<small><span class="fw-bold">Guess:</span> P{{ model.current_race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ model.current_race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{% set race_guess_open = model.race_guess_open(model.current_race) %}
|
||||
{% if race_guess_open == true %}
|
||||
{% set action_save_href = "/race-guess/" ~ model.current_race.name_sanitized ~ "/" ~ model.active_user.name_sanitized %}
|
||||
{% set action_delete_href = "/race-guess-delete/" ~ model.current_race.name_sanitized ~ "/" ~ model.active_user.name_sanitized %}
|
||||
{% else %}
|
||||
{% set action_save_href = "" %}
|
||||
{% set action_delete_href = "" %}
|
||||
{% endif %}
|
||||
|
||||
{# Enter + Save guess #}
|
||||
<form action="{{ action_save_href }}" method="post">
|
||||
{% set user_guess = model.race_guesses_by(user_name=model.active_user.name, race_name=model.current_race.name) %}
|
||||
|
||||
{# Driver PXX Select #}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.pxx_guess, name="pxxselect", label="P" ~ model.current_race.place_to_guess ~ ":", include_none=true, disabled=not race_guess_open) }}
|
||||
|
||||
<div class="mt-2"></div>
|
||||
|
||||
{# Driver DNF Select #}
|
||||
{{ driver_select_with_preselect(driver_match=user_guess.dnf_guess, name="dnfselect", label="DNF:", include_none=true, disabled=not race_guess_open) }}
|
||||
|
||||
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
|
||||
{% if race_guess_open == false %}disabled="disabled"{% endif %}>
|
||||
</form>
|
||||
|
||||
{# 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="disabled"{% endif %}>
|
||||
</form>
|
||||
</td>
|
||||
|
||||
<td> </td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
|
||||
{# Past Race Results #}
|
||||
{% for past_result in model.all_race_results() %}
|
||||
<tr>
|
||||
<td class="text-nowrap">
|
||||
<span class="fw-bold">{{ past_result.race.number }}:</span> {{ past_result.race.name }}<br>
|
||||
<small><span class="fw-bold">Guessed:</span> P{{ past_result.race.place_to_guess }}</small><br>
|
||||
<small><span class="fw-bold">Date:</span> {{ past_result.race.date.strftime("%d.%m %H:%M") }}
|
||||
</small>
|
||||
</td>
|
||||
|
||||
{% if model.all_users_or_active_user() | length > 0 %}
|
||||
{% for user in model.all_users_or_active_user() %}
|
||||
<td class="text-center text-nowrap">
|
||||
{% set user_guess = model.race_guesses_by(user_name=user.name, race_name=past_result.race.name) %}
|
||||
|
||||
{% if user_guess is not none %}
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item {{ pxx_guess_colorization(guessed_driver=user_guess.pxx_guess, result=past_result) }}">
|
||||
<span data-bs-toggle="tooltip"
|
||||
title="{{ past_result.driver_standing_points_string(user_guess.pxx_guess) }}">
|
||||
{{ user_guess.pxx_guess.abbr ~ past_result.driver_standing_position_string(user_guess.pxx_guess) }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item {{ dnf_guess_colorization(guessed_driver=user_guess.dnf_guess, result=past_result) }}">
|
||||
</li>
|
||||
<li class="list-group-item {{ dnf_guess_colorization(guessed_driver=user_guess.dnf_guess, result=past_result) }}">
|
||||
<span data-bs-toggle="tooltip"
|
||||
title="{{ past_result.driver_dnf_points_string(user_guess.dnf_guess) }}">
|
||||
{{ user_guess.dnf_guess.abbr }}
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<td> </td>
|
||||
{% endif %}
|
||||
|
||||
{# Actual result #}
|
||||
<td class="text-center text-nowrap">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
{# Actual result #}
|
||||
<td class="text-center text-nowrap">
|
||||
<ul class="list-group list-group-flush">
|
||||
<li class="list-group-item">
|
||||
<span data-bs-toggle="tooltip" title="{{ pxx_standing_tooltip_text(result=past_result) }}">
|
||||
P{{ past_result.race.place_to_guess }}: {{ past_result.offset_from_place_to_guess(0).abbr }}
|
||||
</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
DNF: {{ past_result.initial_dnf_string() }}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
DNF: {{ past_result.initial_dnf_string() }}</li>
|
||||
</ul>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{% endblock body %}
|
@ -42,80 +42,86 @@
|
||||
|
||||
{% block body %}
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(325px, 1fr)); grid-row-gap: 0; grid-column-gap: 8px;">
|
||||
|
||||
<div class="card shadow-sm mb-2" style="max-width: 450px;">
|
||||
<div class="card-header">
|
||||
{{ model.active_result_race_name_or_current_race_name() }}
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm" style="width: 450px;">
|
||||
<div class="card-body">
|
||||
<div class="d-inline-block overflow-x-scroll w-100">
|
||||
<div style="width: 410px;">
|
||||
{% set race_result_open=model.race_result_open(model.active_result_race_name_or_current_race_name()) %}
|
||||
{% if race_result_open == true %}
|
||||
{% set action_save_href = "/result-enter/" ~ model.active_result_race_name_or_current_race_name_sanitized() %}
|
||||
{% else %}
|
||||
{% set action_save_href = "" %}
|
||||
{% endif %}
|
||||
|
||||
<h5 class="card-title">
|
||||
{{ model.active_result_race_name_or_current_race_name() }}
|
||||
</h5>
|
||||
<form action="{{ action_save_href }}" method="post">
|
||||
<ul class="list-group list-group-flush d-inline-block">
|
||||
{% for driver in model.all_drivers_or_active_result_standing_drivers() %}
|
||||
<li class="list-group-item p-1"><span id="place_number"
|
||||
class="fw-bold">P{{ "%02d" % loop.index }}</span>:
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
{% set race_result_open=model.race_result_open(model.active_result_race_name_or_current_race_name()) %}
|
||||
{% if race_result_open == true %}
|
||||
{% set action_save_href = "/result-enter/" ~ model.active_result_race_name_or_current_race_name_sanitized() %}
|
||||
{% else %}
|
||||
{% set action_save_href = "" %}
|
||||
{% endif %}
|
||||
<ul id="columns" class="list-group list-group-flush d-inline-block float-end">
|
||||
|
||||
<form action="{{ action_save_href }}" method="post">
|
||||
<ul class="list-group list-group-flush d-inline-block">
|
||||
{% for driver in model.all_drivers_or_active_result_standing_drivers() %}
|
||||
<li class="list-group-item p-1"><span id="place_number"
|
||||
class="fw-bold">P{{ "%02d" % loop.index }}</span>:
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
{% for driver in model.all_drivers_or_active_result_standing_drivers() %}
|
||||
<li class="list-group-item {% if race_result_open == true %}column{% endif %} p-1"
|
||||
{% if race_result_open == true %}draggable="true"{% endif %}>
|
||||
{{ driver.name }}
|
||||
|
||||
<ul id="columns" class="list-group list-group-flush d-inline-block float-end">
|
||||
<div class="d-inline-block float-end" style="margin-left: 30px;">
|
||||
{# Driver DNFed at first #}
|
||||
<div class="form-check form-check-reverse d-inline-block">
|
||||
<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 %}readonly="readonly"{% endif %}>
|
||||
<label for="first-dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">1. DNF</label>
|
||||
</div>
|
||||
|
||||
{% for driver in model.all_drivers_or_active_result_standing_drivers() %}
|
||||
<li class="list-group-item {% if race_result_open == true %}column{% endif %} p-1" {% if race_result_open == true %}draggable="true"{% endif %}>
|
||||
{{ driver.name }}
|
||||
{# Driver DNFed #}
|
||||
<div class="form-check form-check-reverse d-inline-block mx-2">
|
||||
<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 %}readonly="readonly"{% endif %}>
|
||||
<label for="dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">DNF</label>
|
||||
</div>
|
||||
|
||||
<div class="d-inline-block float-end" style="margin-left: 30px;">
|
||||
{# Driver DNFed at first #}
|
||||
<div class="form-check form-check-reverse d-inline-block">
|
||||
<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 %}readonly="readonly"{% endif %}>
|
||||
<label for="first-dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">1. DNF</label>
|
||||
</div>
|
||||
{# Driver Excluded #}
|
||||
<div class="form-check form-check-reverse d-inline-block">
|
||||
<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 %}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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Driver DNFed #}
|
||||
<div class="form-check form-check-reverse d-inline-block mx-2">
|
||||
<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 %}readonly="readonly"{% endif %}>
|
||||
<label for="dnf-{{ driver.name }}"
|
||||
class="form-check-label text-muted">DNF</label>
|
||||
</div>
|
||||
|
||||
{# Driver Excluded #}
|
||||
<div class="form-check form-check-reverse d-inline-block">
|
||||
<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 %}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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# Standing order #}
|
||||
<input type="hidden" name="pxx-drivers" value="{{ driver.name }}">
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
|
||||
{% if race_result_open == false %}disabled="disabled"{% endif %}>
|
||||
</form>
|
||||
{# Standing order #}
|
||||
<input type="hidden" name="pxx-drivers" value="{{ driver.name }}">
|
||||
</li>
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
|
||||
{% if race_result_open == false %}disabled="disabled"{% endif %}>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -5,10 +5,12 @@
|
||||
{% set active_page = "/rules" %}
|
||||
|
||||
{% block body %}
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Format</h5>
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Format
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>
|
||||
Das Tippspiel wird dieses Jahr in zwei Teile aufgespalten: Renntips (für jedes Rennen) und Bonustipps
|
||||
(für die ganze Saison).
|
||||
@ -20,10 +22,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Renntipps</h5>
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Renntipps
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>
|
||||
Jedes Rennen besteht aus zwei Tipps.
|
||||
Einem Platzierungstipp (PX-Tipp) und einem Tipp welcher Fahrer als Erstes das Rennen abbricht
|
||||
@ -39,10 +43,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Punkte</h5>
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Punkte
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>
|
||||
Für einen korrekten Tipp werden 10 Punkte vergeben.
|
||||
Beim PX-Tipp werden 6 Punkte für einen Platz Abweichung, 3 Punkte für zwei plätze Abweichung und 1 Punkt
|
||||
@ -56,10 +62,12 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mt-2">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Bonustipps</h5>
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Bonustipps
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<p>
|
||||
Zusätzlich gibt es dieses Jahr auch Tipps, die sich auf die ganze Saison beziehen und verschieden
|
||||
bepunktet werden.
|
||||
|
@ -11,28 +11,32 @@
|
||||
{% block body %}
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Note
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Note</h5>
|
||||
Picks that match the current standings are marked in green, except for the hot-take and overtake picks, as those are not evaluated automatically.<br>
|
||||
Picks that match the current standings are marked in green, except for the hot-take and overtake picks, as
|
||||
those are not evaluated automatically.<br>
|
||||
Points from sprints and fastest laps are not tracked currently.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(325px, 1fr)); grid-row-gap: 0; grid-column-gap: 8px;">
|
||||
|
||||
{% for user in model.all_users_or_active_user() %}
|
||||
|
||||
<div class="card mb-2 shadow-sm">
|
||||
<div class="card-body">
|
||||
|
||||
<div class="card-header">
|
||||
{# Link should only be visible if all users are visible #}
|
||||
{% if model.active_user is not none %}
|
||||
<h5 class="card-title">{{ user.name }}</h5>
|
||||
{{ user.name }}
|
||||
{% else %}
|
||||
<a href="/season/{{ user.name }}" class="link-dark">
|
||||
<h5 class="card-title">{{ user.name }}</h5>
|
||||
</a>
|
||||
<a href="/season/{{ user.name }}" class="link-dark">{{ user.name }}</a>
|
||||
{% endif %}
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
|
||||
{% set user_guess = model.season_guesses_by(user_name=user.name) %}
|
||||
|
||||
@ -78,11 +82,11 @@
|
||||
<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(),
|
||||
label="Most WDC pl. 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,
|
||||
label="Most WDC pl. lost:", include_none=false, disabled=not season_guess_open,
|
||||
border=("border-success" if points.most_lost_correct(user.name) else "")) }}
|
||||
</div>
|
||||
|
||||
@ -90,7 +94,7 @@
|
||||
<h6 class="card-subtitle mt-2" data-bs-toggle="tooltip"
|
||||
title="Which driver will finish the season higher than his teammate?">Teammate battle
|
||||
winners:</h6>
|
||||
<div class="grid mt-2" style="width: 450px; row-gap: 0;">
|
||||
<div class="grid mt-2 container" style="row-gap: 0;">
|
||||
{% for team in model.all_teams(include_none=false) %}
|
||||
{% set driver_a = model.drivers_by(team_name=team.name)[0] %}
|
||||
{% set driver_b = model.drivers_by(team_name=team.name)[1] %}
|
||||
@ -126,7 +130,7 @@
|
||||
{# Drivers with Podiums #}
|
||||
<h6 class="card-subtitle mt-2" data-bs-toggle="tooltip"
|
||||
title="Which driver will reach at least a single podium?">Drivers with podium(s):</h6>
|
||||
<div class="grid mt-2" style="width: 450px; row-gap: 0;">
|
||||
<div class="grid mt-2 container" style="row-gap: 0;">
|
||||
{% for team in model.all_teams(include_none=false) %}
|
||||
{% set driver_a = model.drivers_by(team_name=team.name)[0] %}
|
||||
{% set driver_b = model.drivers_by(team_name=team.name)[1] %}
|
||||
|
@ -7,67 +7,78 @@
|
||||
{% block body %}
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Note
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Note</h5>
|
||||
Points from sprints and fastest laps are not tracked currently.
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));">
|
||||
<div class="grid" style="grid-template-columns: repeat(auto-fit, minmax(325px, 1fr)); grid-row-gap: 0; grid-column-gap: 8px;">
|
||||
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Drivers
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Drivers</h5>
|
||||
|
||||
<table class="table table-bordered table-sm table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Driver</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">DNFs</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for driver in points.drivers_sorted_by_points() %}
|
||||
{% set driver_standing = points.wdc_standing_by_driver()[driver.name] %}
|
||||
<tr class="{% if driver_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ driver_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ driver.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.wdc_points()[driver.name] }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.dnfs()[driver.name] }}</td>
|
||||
<div class="d-inline-block overflow-x-scroll w-100">
|
||||
<table class="table table-bordered table-sm table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Driver</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">DNFs</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for driver in points.drivers_sorted_by_points() %}
|
||||
{% set driver_standing = points.wdc_standing_by_driver()[driver.name] %}
|
||||
<tr class="{% if driver_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ driver_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ driver.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.wdc_points()[driver.name] }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.dnfs()[driver.name] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card mb-2">
|
||||
<div class="card-header">
|
||||
Constructors
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Constructors</h5>
|
||||
|
||||
<table class="table table-bordered table-sm table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Team</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for team in points.teams_sorted_by_points() %}
|
||||
{% set team_standing = points.wcc_standing_by_team()[team.name] %}
|
||||
<tr class="{% if team_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ team_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ team.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.wcc_points()[team.name] }}</td>
|
||||
<div class="d-inline-block overflow-x-scroll w-100">
|
||||
<table class="table table-bordered table-sm table-responsive">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Place</th>
|
||||
<th scope="col" class="text-center" style="min-width: 50px;">Team</th>
|
||||
<th scope="col" class="text-center" style="min-width: 100px;">Points</th>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
{% for team in points.teams_sorted_by_points() %}
|
||||
{% set team_standing = points.wcc_standing_by_team()[team.name] %}
|
||||
<tr class="{% if team_standing == 1 %}table-danger{% endif %}">
|
||||
<td class="text-center text-nowrap">{{ team_standing }}</td>
|
||||
<td class="text-center text-nowrap">{{ team.name }}</td>
|
||||
<td class="text-center text-nowrap">{{ points.wcc_points()[team.name] }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -7,9 +7,11 @@
|
||||
{% block body %}
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Add User</h5>
|
||||
<div class="card-header">
|
||||
Add user
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="/user-add" method="post">
|
||||
<div class="input-group">
|
||||
<div class="form-floating">
|
||||
@ -26,9 +28,11 @@
|
||||
|
||||
{% if model.all_users() | length > 0 %}
|
||||
<div class="card mt-2 shadow-sm">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Registered Users</h5>
|
||||
<div class="card-header">
|
||||
Registered users
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<ul class="list-group list-group-flush">
|
||||
{% for user in model.all_users() %}
|
||||
<li class="list-group-item">{{ user.name }}</li>
|
||||
@ -38,9 +42,11 @@
|
||||
</div>
|
||||
|
||||
<div class="card mt-2 shadow-sm">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Delete user</h5>
|
||||
<div class="card-header">
|
||||
Delete user
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<form action="/user-delete" method="post">
|
||||
<div class="input-group">
|
||||
<select class="form-control form-select" aria-label="select-delete-user"
|
||||
|
Reference in New Issue
Block a user