diff --git a/tournaments/models/club.py b/tournaments/models/club.py
index b6cf4ac..0fc4f0d 100644
--- a/tournaments/models/club.py
+++ b/tournaments/models/club.py
@@ -34,3 +34,12 @@ class Club(models.Model):
return f"Terrain {index + 1}"
return ""
+
+ def has_address(self):
+ return self.address and self.zip_code and self.city
+
+ def city_zipcode(self):
+ if self.has_address():
+ return f"{self.zip_code} {self.city}"
+ else:
+ return ""
diff --git a/tournaments/models/match.py b/tournaments/models/match.py
index 06be6bb..f9c0f02 100644
--- a/tournaments/models/match.py
+++ b/tournaments/models/match.py
@@ -185,9 +185,10 @@ class Match(models.Model):
date = self.formatted_start_date()
duration = self.time_indication()
court = self.court_name(self.court_index)
+ group_stage_name = self.group_stage.display_name()
ended = self.end_date is not None
- livematch = LiveMatch(title, date, duration, court, self.started(), ended)
+ livematch = LiveMatch(title, date, duration, court, self.started(), ended, group_stage_name)
for team_score in self.sorted_team_scores():
if team_score.team_registration:
@@ -249,7 +250,7 @@ class Team:
}
class LiveMatch:
- def __init__(self, title, date, duration, court, started, ended):
+ def __init__(self, title, date, duration, court, started, ended, group_stage_name):
self.title = title
self.date = date
self.teams = []
@@ -258,6 +259,7 @@ class LiveMatch:
self.started = started
self.ended = ended
self.has_walk_out = False
+ self.group_stage_name = group_stage_name
def add_team(self, team):
self.teams.append(team)
@@ -274,6 +276,7 @@ class LiveMatch:
"started": self.started,
"ended": self.ended,
"has_walk_out": self.has_walk_out,
+ "group_stage_name": self.group_stage_name,
}
def show_duration(self):
diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py
index 49b8665..086dae1 100644
--- a/tournaments/models/tournament.py
+++ b/tournaments/models/tournament.py
@@ -9,6 +9,7 @@ from django.utils import timezone, formats
from datetime import datetime, timedelta
from .. import config_local
from ..utils.cryptography import decrypt_aes_gcm
+from ..utils.extensions import plural_format
class TeamSortingType(models.IntegerChoices):
RANK = 1, 'Rank'
@@ -595,7 +596,7 @@ class Tournament(models.Model):
return True
bracket_matches = self.bracket_matches()
if len(bracket_matches) == 0:
- return self.display_group_stages
+ return self.display_group_stages()
if self.publish_brackets:
return True
@@ -641,6 +642,15 @@ class Tournament(models.Model):
def is_build_and_not_empty(self):
return (len(self.groupstage_set.all()) > 0 or len(self.round_set.all()) > 0) and len(self.teamregistration_set.all()) >= 4
+ def day_duration_formatted(self):
+ return plural_format("jour", self.day_duration)
+
+ def has_club_address(self):
+ if self.event.club:
+ return self.event.club.has_address()
+ else:
+ return False
+
class MatchGroup:
def __init__(self, name, matches):
self.name = name
diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html
index d43b92e..ec53e31 100644
--- a/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html
+++ b/tournaments/templates/tournaments/broadcast/broadcasted_group_stage.html
@@ -1,7 +1,7 @@
-
+
@@ -32,13 +32,13 @@
diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_match.html b/tournaments/templates/tournaments/broadcast/broadcasted_match.html
index 26d2c82..66758cc 100644
--- a/tournaments/templates/tournaments/broadcast/broadcasted_match.html
+++ b/tournaments/templates/tournaments/broadcast/broadcasted_match.html
@@ -1,7 +1,9 @@
-
+
diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_ranking.html b/tournaments/templates/tournaments/broadcast/broadcasted_ranking.html
index f89ec96..f90b364 100644
--- a/tournaments/templates/tournaments/broadcast/broadcasted_ranking.html
+++ b/tournaments/templates/tournaments/broadcast/broadcasted_ranking.html
@@ -11,7 +11,7 @@
-
+
diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_summon.html b/tournaments/templates/tournaments/broadcast/broadcasted_summon.html
index 136657c..4875ad1 100644
--- a/tournaments/templates/tournaments/broadcast/broadcasted_summon.html
+++ b/tournaments/templates/tournaments/broadcast/broadcasted_summon.html
@@ -8,7 +8,7 @@
-
+
diff --git a/tournaments/templates/tournaments/group_stage_cell.html b/tournaments/templates/tournaments/group_stage_cell.html
index d26407f..cf28319 100644
--- a/tournaments/templates/tournaments/group_stage_cell.html
+++ b/tournaments/templates/tournaments/group_stage_cell.html
@@ -25,12 +25,12 @@
{% if tournament.hide_weight %}
{% else %}
- {{ team.weight }}
+ {{ team.weight }}
{% endif %}
{% else %}
-
{{ team.wins_losses }}
-
{{ team.formatted_diff }}
+
{{ team.wins_losses }}
+
{{ team.formatted_diff }}
{% endif %}
diff --git a/tournaments/templates/tournaments/navigation_tournament.html b/tournaments/templates/tournaments/navigation_tournament.html
index 18388c6..cb26aad 100644
--- a/tournaments/templates/tournaments/navigation_tournament.html
+++ b/tournaments/templates/tournaments/navigation_tournament.html
@@ -1,4 +1,7 @@