From ae115bc4cbe7a94f2e810b9b1a06e5796c51ab19 Mon Sep 17 00:00:00 2001 From: Raz Date: Thu, 3 Apr 2025 19:24:02 +0200 Subject: [PATCH] add championship type --- tournaments/models/enums.py | 1 + tournaments/models/tournament.py | 2 ++ tournaments/static/tournaments/css/style.css | 6 ++++++ tournaments/templates/tournaments/tournament_info.html | 5 +++++ tournaments/templates/tournaments/tournament_row.html | 3 +++ 5 files changed, 17 insertions(+) diff --git a/tournaments/models/enums.py b/tournaments/models/enums.py index c92c2c1..88f9284 100644 --- a/tournaments/models/enums.py +++ b/tournaments/models/enums.py @@ -48,6 +48,7 @@ class FederalLevelCategory(models.IntegerChoices): P1000 = 1000, 'P1000' P1500 = 1500, 'P1500' P2000 = 2000, 'P2000' + CHPT = 1, 'Championnat' @staticmethod def min_player_rank(level=None, category=None, age_category=None) -> int: diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 13d4679..3f6d2cb 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -180,6 +180,8 @@ class Tournament(BaseModel): def level(self): if self.federal_level_category == 0: return "Anim." + if self.federal_level_category == 1: + return "CHPT" return self.get_federal_level_category_display() def category(self): diff --git a/tournaments/static/tournaments/css/style.css b/tournaments/static/tournaments/css/style.css index 559a059..16404ef 100644 --- a/tournaments/static/tournaments/css/style.css +++ b/tournaments/static/tournaments/css/style.css @@ -766,6 +766,12 @@ h-margin { /* Keep any existing styling for .large */ } +.small.event-name { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} + .table-row-element.tournament-status { grid-column: 4; } diff --git a/tournaments/templates/tournaments/tournament_info.html b/tournaments/templates/tournaments/tournament_info.html index d3a112b..06839f7 100644 --- a/tournaments/templates/tournaments/tournament_info.html +++ b/tournaments/templates/tournaments/tournament_info.html @@ -70,6 +70,11 @@ {% endif %}

{{ tournament.display_name }} {{ tournament.get_federal_age_category_display}}

+ + {% if tournament.event.name %} + + {% endif %} +

{{ tournament.local_start_date_formatted }}
{{ tournament.day_duration_formatted }}
diff --git a/tournaments/templates/tournaments/tournament_row.html b/tournaments/templates/tournaments/tournament_row.html index 8bb0183..04d017b 100644 --- a/tournaments/templates/tournaments/tournament_row.html +++ b/tournaments/templates/tournaments/tournament_row.html @@ -18,6 +18,9 @@
{{ tournament.event.club.name }}
+ {% if tournament.event.name %} +
{{ tournament.event.name }}
+ {% endif %}
{{ tournament.localized_day_duration }}