From 78c41da1d0bc9c58d058f9246c0636d4a55409dc Mon Sep 17 00:00:00 2001 From: Laurent Date: Thu, 30 May 2024 18:03:45 +0200 Subject: [PATCH] cleanup broadcast html --- tournaments/models/match.py | 5 +- tournaments/models/tournament.py | 6 +- tournaments/static/tournaments/css/style.css | 49 ++++++-- .../templates/tournaments/broadcast_base.html | 34 +++--- .../tournaments/broadcasted_group_stage.html | 9 +- .../tournaments/broadcasted_group_stages.html | 34 +++--- .../tournaments/broadcasted_match.html | 12 +- .../tournaments/broadcasted_matches.html | 110 +++--------------- 8 files changed, 95 insertions(+), 164 deletions(-) diff --git a/tournaments/models/match.py b/tournaments/models/match.py index 4587b99..42d5909 100644 --- a/tournaments/models/match.py +++ b/tournaments/models/match.py @@ -34,7 +34,10 @@ class Match(models.Model): return self.group_stage.tournament def court_name(self, index): - club = self.tournament().event.club + club = None + if self.tournament().event: + club = self.tournament().event.club + if club: return club.court_name(index) elif index is not None: diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index 408b06c..48ab5f9 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -131,7 +131,10 @@ class Tournament(models.Model): return None def name_and_event(self): - event_name = self.event.name + event_name = None + if self.event: + event_name = self.event.name + if event_name and self.name: return event_name + " : " + self.name elif event_name: @@ -141,7 +144,6 @@ class Tournament(models.Model): else: return None - def team_summons(self): summons = [] for team_registration in self.teamregistration_set.all(): diff --git a/tournaments/static/tournaments/css/style.css b/tournaments/static/tournaments/css/style.css index caeac88..91c9baf 100644 --- a/tournaments/static/tournaments/css/style.css +++ b/tournaments/static/tournaments/css/style.css @@ -31,6 +31,7 @@ body { label { color: #707070; + font-size: 1.1em; } h1 { @@ -80,11 +81,6 @@ nav a { font-weight: 600; } */ -.container { - /* width: 100%; */ - /* text-align:center; */ -} - .wrapper { margin: 0px 10px; } @@ -116,10 +112,6 @@ table { font-size: 1.1em; } -label { - font-size: 1.1em; -} - td { padding: 3px 0px; } @@ -286,6 +278,14 @@ svg { border-radius: 16px; } +.padding { + padding: 100px; +} + +h-margin { + margin: 100px; +} + .bubble { padding: 20px; background-color: white; @@ -312,6 +312,10 @@ svg { /* width: 25%; */ } +.fit { + width: fit-content; +} + .inline { display: inline-block; /* box-sizing: border-box; */ @@ -543,6 +547,14 @@ svg { padding: 5px 0px; } +.table-row-2-column-header { + display: grid; + grid-template-columns: auto 1fr; + align-items: center; + /* Vertically center the content within each column */ + padding: 5px 0px; +} + .table-row-2-colums { display: grid; grid-template-columns: 2fr 60px; @@ -690,3 +702,22 @@ screen and (min-width: 80em) { vertical-align: middle; padding: 5px 0px; } + + + + +#header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20px 40px; +} + +.left-content { + display: flex; + align-items: center; +} + +.right-content { + margin-left: auto; +} diff --git a/tournaments/templates/tournaments/broadcast_base.html b/tournaments/templates/tournaments/broadcast_base.html index 6973ccd..e3f1d5f 100644 --- a/tournaments/templates/tournaments/broadcast_base.html +++ b/tournaments/templates/tournaments/broadcast_base.html @@ -13,29 +13,21 @@ -
-
-
-
-
- -
-

{% block first_title %}Page Title{% endblock %}

-

{% block second_title %}Page Title{% endblock %}

- -
-
-
-
-
- {% qr_from_text qr_code_url options=qr_code_options %} -
+ +
+
+
{% qr_from_text qr_code_url options=qr_code_options %}
+
+
+ +
diff --git a/tournaments/templates/tournaments/broadcasted_group_stage.html b/tournaments/templates/tournaments/broadcasted_group_stage.html index 856f0d6..1bf2df4 100644 --- a/tournaments/templates/tournaments/broadcasted_group_stage.html +++ b/tournaments/templates/tournaments/broadcasted_group_stage.html @@ -12,7 +12,10 @@
@@ -50,7 +53,7 @@
- +
diff --git a/tournaments/templates/tournaments/broadcasted_group_stages.html b/tournaments/templates/tournaments/broadcasted_group_stages.html index e4a0548..5f2a2e9 100644 --- a/tournaments/templates/tournaments/broadcasted_group_stages.html +++ b/tournaments/templates/tournaments/broadcasted_group_stages.html @@ -44,31 +44,23 @@ }" x-init="loop()"> +
+ +
+
-
-
-
- -
-

{{ tournament.display_name }}

-

Poules

- -
-
-
-
-
- {% qr_from_text qr_code_url options=qr_code_options %} -
-
-
-