Many frontend improvements
All checks were successful
Build Formula10 Docker Image / build-docker (push) Successful in 14s

This commit is contained in:
2024-03-03 00:06:52 +01:00
parent c2c71a32e8
commit 64d37acc23
7 changed files with 375 additions and 318 deletions

View File

@ -7,18 +7,32 @@
{% block body %} {% block body %}
<div class="card"> <div class="card">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Leaderboard</h5> Note
<h6 class="card-subtitle">Points only include race picks</h6> </div>
<table class="table table-bordered table-sm table-responsive mt-3"> <div class="card-body">
Points only include race picks.
</div>
</div>
<div class="card mt-2">
<div class="card-header">
Leaderboard
</div>
<div class="card-body">
<div class="d-inline-block overflow-x-scroll w-100">
<table class="table table-bordered table-sm table-responsive">
<thead> <thead>
<tr> <tr>
<th scope="col" class="text-center" style="min-width: 50px;">Place</th> <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: 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;">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;">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;" 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> <th scope="col" class="text-center" style="min-width: 100px;">Points per pick</th>
</tr> </tr>
</thead> </thead>
@ -39,6 +53,7 @@
</table> </table>
</div> </div>
</div> </div>
</div>
{# <div class="card mt-2">#} {# <div class="card mt-2">#}
{# <div class="card-body">#} {# <div class="card-body">#}

View File

@ -14,7 +14,10 @@
{% block body %} {% block body %}
{# 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"> <table class="table table-bordered table-sm table-responsive shadow-sm">
<thead> <thead>
<tr> <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;">Race</th>
@ -35,11 +38,14 @@
{# Link should only be visible if all users are visible #} {# Link should only be visible if all users are visible #}
{% if model.active_user is not none %} {% 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> <td class="text-center text-nowrap" style="min-width: 100px;">{{ model.active_user.name }}
({{ points.total_points_by(model.active_user.name) }})
</td>
{% else %} {% else %}
{% for user in model.all_users() %} {% for user in model.all_users() %}
<td class="text-center text-nowrap" style="min-width: 100px;"> <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> <a href="/race/{{ user.name_sanitized }}" class="link-dark">{{ user.name }}
({{ points.total_points_by(user.name) }})</a>
</td> </td>
{% endfor %} {% endfor %}
{% endif %} {% endif %}
@ -193,5 +199,6 @@
</tbody> </tbody>
</table> </table>
</div>
{% endblock body %} {% endblock body %}

View File

@ -42,15 +42,16 @@
{% block body %} {% 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" style="width: 450px;"> <div class="card shadow-sm mb-2" style="max-width: 450px;">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">
{{ model.active_result_race_name_or_current_race_name() }} {{ model.active_result_race_name_or_current_race_name() }}
</h5> </div>
<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()) %} {% set race_result_open=model.race_result_open(model.active_result_race_name_or_current_race_name()) %}
{% if race_result_open == true %} {% if race_result_open == true %}
{% set action_save_href = "/result-enter/" ~ model.active_result_race_name_or_current_race_name_sanitized() %} {% set action_save_href = "/result-enter/" ~ model.active_result_race_name_or_current_race_name_sanitized() %}
@ -70,13 +71,15 @@
<ul id="columns" class="list-group list-group-flush d-inline-block float-end"> <ul id="columns" class="list-group list-group-flush d-inline-block float-end">
{% for driver in model.all_drivers_or_active_result_standing_drivers() %} {% 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 %}> <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.name }}
<div class="d-inline-block float-end" style="margin-left: 30px;"> <div class="d-inline-block float-end" style="margin-left: 30px;">
{# Driver DNFed at first #} {# Driver DNFed at first #}
<div class="form-check form-check-reverse d-inline-block"> <div class="form-check form-check-reverse d-inline-block">
<input type="checkbox" class="form-check-input" value="{{ driver.name }}" <input type="checkbox" class="form-check-input"
value="{{ driver.name }}"
id="first-dnf-{{ driver.name }}" name="first-dnf-drivers" 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 (model.active_result is not none) and (driver in model.active_result.initial_dnf) %}checked{% endif %}
{% if race_result_open == false %}readonly="readonly"{% endif %}> {% if race_result_open == false %}readonly="readonly"{% endif %}>
@ -86,7 +89,8 @@
{# Driver DNFed #} {# Driver DNFed #}
<div class="form-check form-check-reverse d-inline-block mx-2"> <div class="form-check form-check-reverse d-inline-block mx-2">
<input type="checkbox" class="form-check-input" value="{{ driver.name }}" <input type="checkbox" class="form-check-input"
value="{{ driver.name }}"
id="dnf-{{ driver.name }}" name="dnf-drivers" 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 (model.active_result is not none) and (driver in model.active_result.all_dnfs) %}checked{% endif %}
{% if race_result_open == false %}readonly="readonly"{% endif %}> {% if race_result_open == false %}readonly="readonly"{% endif %}>
@ -96,7 +100,8 @@
{# Driver Excluded #} {# Driver Excluded #}
<div class="form-check form-check-reverse d-inline-block"> <div class="form-check form-check-reverse d-inline-block">
<input type="checkbox" class="form-check-input" value="{{ driver.name }}" <input type="checkbox" class="form-check-input"
value="{{ driver.name }}"
id="exclude-{{ driver.name }}" name="excluded-drivers" 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 (model.active_result is not none) and (driver in model.active_result.standing_exclusions) %}checked{% endif %}
{% if race_result_open == false %}readonly="readonly"{% endif %}> {% if race_result_open == false %}readonly="readonly"{% endif %}>
@ -115,7 +120,8 @@
<input type="submit" class="btn btn-danger mt-2 w-100" value="Save" <input type="submit" class="btn btn-danger mt-2 w-100" value="Save"
{% if race_result_open == false %}disabled="disabled"{% endif %}> {% if race_result_open == false %}disabled="disabled"{% endif %}>
</form> </form>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -5,10 +5,12 @@
{% set active_page = "/rules" %} {% set active_page = "/rules" %}
{% block body %} {% block body %}
<div class="card"> <div class="card mb-2">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Format</h5> Format
</div>
<div class="card-body">
<p> <p>
Das Tippspiel wird dieses Jahr in zwei Teile aufgespalten: Renntips (für jedes Rennen) und Bonustipps Das Tippspiel wird dieses Jahr in zwei Teile aufgespalten: Renntips (für jedes Rennen) und Bonustipps
(für die ganze Saison). (für die ganze Saison).
@ -20,10 +22,12 @@
</div> </div>
</div> </div>
<div class="card mt-2"> <div class="card mb-2">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Renntipps</h5> Renntipps
</div>
<div class="card-body">
<p> <p>
Jedes Rennen besteht aus zwei Tipps. Jedes Rennen besteht aus zwei Tipps.
Einem Platzierungstipp (PX-Tipp) und einem Tipp welcher Fahrer als Erstes das Rennen abbricht Einem Platzierungstipp (PX-Tipp) und einem Tipp welcher Fahrer als Erstes das Rennen abbricht
@ -39,10 +43,12 @@
</div> </div>
</div> </div>
<div class="card mt-2"> <div class="card mb-2">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Punkte</h5> Punkte
</div>
<div class="card-body">
<p> <p>
Für einen korrekten Tipp werden 10 Punkte vergeben. 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 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> </div>
<div class="card mt-2"> <div class="card mb-2">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Bonustipps</h5> Bonustipps
</div>
<div class="card-body">
<p> <p>
Zusätzlich gibt es dieses Jahr auch Tipps, die sich auf die ganze Saison beziehen und verschieden Zusätzlich gibt es dieses Jahr auch Tipps, die sich auf die ganze Saison beziehen und verschieden
bepunktet werden. bepunktet werden.

View File

@ -11,28 +11,32 @@
{% block body %} {% block body %}
<div class="card mb-2"> <div class="card mb-2">
<div class="card-header">
Note
</div>
<div class="card-body"> <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
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> those are not evaluated automatically.<br>
Points from sprints and fastest laps are not tracked currently. Points from sprints and fastest laps are not tracked currently.
</div> </div>
</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() %} {% for user in model.all_users_or_active_user() %}
<div class="card mb-2 shadow-sm"> <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 #} {# Link should only be visible if all users are visible #}
{% if model.active_user is not none %} {% if model.active_user is not none %}
<h5 class="card-title">{{ user.name }}</h5> {{ user.name }}
{% else %} {% else %}
<a href="/season/{{ user.name }}" class="link-dark"> <a href="/season/{{ user.name }}" class="link-dark">{{ user.name }}</a>
<h5 class="card-title">{{ user.name }}</h5>
</a>
{% endif %} {% endif %}
</div>
<div class="card-body">
{% set user_guess = model.season_guesses_by(user_name=user.name) %} {% 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" <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?"> 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", {{ 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, disabled=not season_guess_open,
border=("border-success" if points.most_gained_correct(user.name) else "")) }} border=("border-success" if points.most_gained_correct(user.name) else "")) }}
{{ driver_select_with_preselect(driver_match=user_guess.most_wdc_lost, name="lostselect", {{ 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 "")) }} border=("border-success" if points.most_lost_correct(user.name) else "")) }}
</div> </div>
@ -90,7 +94,7 @@
<h6 class="card-subtitle mt-2" data-bs-toggle="tooltip" <h6 class="card-subtitle mt-2" data-bs-toggle="tooltip"
title="Which driver will finish the season higher than his teammate?">Teammate battle title="Which driver will finish the season higher than his teammate?">Teammate battle
winners:</h6> 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) %} {% for team in model.all_teams(include_none=false) %}
{% set driver_a = model.drivers_by(team_name=team.name)[0] %} {% set driver_a = model.drivers_by(team_name=team.name)[0] %}
{% set driver_b = model.drivers_by(team_name=team.name)[1] %} {% set driver_b = model.drivers_by(team_name=team.name)[1] %}
@ -126,7 +130,7 @@
{# Drivers with Podiums #} {# Drivers with Podiums #}
<h6 class="card-subtitle mt-2" data-bs-toggle="tooltip" <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> 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) %} {% for team in model.all_teams(include_none=false) %}
{% set driver_a = model.drivers_by(team_name=team.name)[0] %} {% set driver_a = model.drivers_by(team_name=team.name)[0] %}
{% set driver_b = model.drivers_by(team_name=team.name)[1] %} {% set driver_b = model.drivers_by(team_name=team.name)[1] %}

View File

@ -7,18 +7,24 @@
{% block body %} {% block body %}
<div class="card mb-2"> <div class="card mb-2">
<div class="card-header">
Note
</div>
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Note</h5>
Points from sprints and fastest laps are not tracked currently. Points from sprints and fastest laps are not tracked currently.
</div> </div>
</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 mb-2">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Drivers</h5> Drivers
</div>
<div class="card-body">
<div class="d-inline-block overflow-x-scroll w-100">
<table class="table table-bordered table-sm table-responsive"> <table class="table table-bordered table-sm table-responsive">
<thead> <thead>
<tr> <tr>
@ -43,11 +49,15 @@
</table> </table>
</div> </div>
</div> </div>
</div>
<div class="card mb-2">
<div class="card-header">
Constructors
</div>
<div class="card">
<div class="card-body"> <div class="card-body">
<h5 class="card-title">Constructors</h5> <div class="d-inline-block overflow-x-scroll w-100">
<table class="table table-bordered table-sm table-responsive"> <table class="table table-bordered table-sm table-responsive">
<thead> <thead>
<tr> <tr>
@ -70,6 +80,7 @@
</table> </table>
</div> </div>
</div> </div>
</div>
</div> </div>

View File

@ -7,9 +7,11 @@
{% block body %} {% block body %}
<div class="card shadow-sm"> <div class="card shadow-sm">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Add User</h5> Add user
</div>
<div class="card-body">
<form action="/user-add" method="post"> <form action="/user-add" method="post">
<div class="input-group"> <div class="input-group">
<div class="form-floating"> <div class="form-floating">
@ -26,9 +28,11 @@
{% if model.all_users() | length > 0 %} {% if model.all_users() | length > 0 %}
<div class="card mt-2 shadow-sm"> <div class="card mt-2 shadow-sm">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Registered Users</h5> Registered users
</div>
<div class="card-body">
<ul class="list-group list-group-flush"> <ul class="list-group list-group-flush">
{% for user in model.all_users() %} {% for user in model.all_users() %}
<li class="list-group-item">{{ user.name }}</li> <li class="list-group-item">{{ user.name }}</li>
@ -38,9 +42,11 @@
</div> </div>
<div class="card mt-2 shadow-sm"> <div class="card mt-2 shadow-sm">
<div class="card-body"> <div class="card-header">
<h5 class="card-title">Delete user</h5> Delete user
</div>
<div class="card-body">
<form action="/user-delete" method="post"> <form action="/user-delete" method="post">
<div class="input-group"> <div class="input-group">
<select class="form-control form-select" aria-label="select-delete-user" <select class="form-control form-select" aria-label="select-delete-user"