From 516fa107e5e2fc8ba0f3ada50e7b6b350717f049 Mon Sep 17 00:00:00 2001 From: Christoph Urlacher Date: Fri, 16 Feb 2024 00:18:55 +0100 Subject: [PATCH] Allow selecting single users to view --- templates/base.jinja | 16 +++++++++++++--- templates/race.jinja | 25 ++++++++++++++++++++----- templates/season.jinja | 33 +++++++++++++++++++++++++-------- 3 files changed, 58 insertions(+), 16 deletions(-) diff --git a/templates/base.jinja b/templates/base.jinja index fb5810a..7ee205c 100644 --- a/templates/base.jinja +++ b/templates/base.jinja @@ -3,7 +3,7 @@ {# Easy nav-bar entries. When a page sets the active_page variable, the current entry will be underlined #} {% macro nav_selector(page='', text='') %} - {% if active_page == page %}{% endif %} {{ text }} + {% if active_page == page %}{% endif %} {{ text }} {% if active_page == page %}{% endif %} {% endmacro %} @@ -110,18 +110,28 @@ Logo - Formula 10 - 2024 + Formula 10 + + diff --git a/templates/race.jinja b/templates/race.jinja index a50cf22..be105d1 100644 --- a/templates/race.jinja +++ b/templates/race.jinja @@ -2,7 +2,22 @@ {% set active_page = "race" %} -{% block title %}Formula 10{% endblock title %} +{% block title %}Formula 10 - Race{% endblock title %} + +{% block navbar_center %} + +{% endblock navbar_center %} {% block body %} @@ -10,7 +25,7 @@ Race - Call + Call Result @@ -21,7 +36,7 @@   - {% for user in users %} + {% for user in chosenusers %} {{ user.name }} {% endfor %} @@ -33,7 +48,7 @@ {{ nextrace.id }}: {{ nextrace.grandprix }} - {% for user in users %} + {% for user in chosenusers %}
{# Driver PXX Select #} @@ -73,7 +88,7 @@ {{ raceresult.race.id }}: {{ raceresult.race.grandprix }} - {% for user in users %} + {% for user in chosenusers %} {% if (raceresult.race_id in pastguesses) and (user.name in pastguesses.get(raceresult.race_id)) %} {% set pxx = pastguesses.get(raceresult.race_id).get(user.name).pxx.abbr %} diff --git a/templates/season.jinja b/templates/season.jinja index a14a013..96f8c7f 100644 --- a/templates/season.jinja +++ b/templates/season.jinja @@ -2,13 +2,30 @@ {% set active_page = "season" %} -{% block title %}Formula 10{% endblock title %} +{% block title %}Formula 10 - Season{% endblock title %} + +{% block navbar_center %} + +{% endblock navbar_center %} {% block body %} +

All fields (of a single user, excluding podiums) must be set or your inputs won't be saved!

+
- {% for user in users %} -
+ {% for user in chosenusers %} +
{{ user.name }}
@@ -24,31 +41,31 @@ {# P2 Constructor #}
{{ team_select_with_preselect(currentselection.get(user.name).p2_constructor.name if user.name in currentselection else "", - "p2select", "P2 Constructor:") }} + "p2select", "P2 Constructor:") }}
{# Most Overtakes #}
{{ driver_select_with_preselect(currentselection.get(user.name).most_overtakes.abbr if user.name in currentselection else "", - "overtakeselect", "Most Overtakes:") }} + "overtakeselect", "Most Overtakes:") }}
{# Most DNFs #}
{{ driver_select_with_preselect(currentselection.get(user.name).most_dnfs.abbr if user.name in currentselection else "", - "dnfselect", "Most DNFs:") }} + "dnfselect", "Most DNFs:") }}
{# Most Gained #}
{{ driver_select_with_preselect(currentselection.get(user.name).most_gained.abbr if user.name in currentselection else "", - "gainedselect", "Most Championship Positions gained:") }} + "gainedselect", "Most Championship Positions gained:") }}
{# Most Lost #}
{{ driver_select_with_preselect(currentselection.get(user.name).most_lost.abbr if user.name in currentselection else "", - "lostselect", "Most Championship Positions lost:") }} + "lostselect", "Most Championship Positions lost:") }}
{# Team-internal Winners #}