diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index cdd124b..43e3b44 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -906,6 +906,8 @@ class Tournament(BaseModel): return self.has_team_registrations() if self.has_started(): return self.has_team_registrations() + if self.will_start_soon(1): + return True return False def display_prog(self): @@ -915,6 +917,8 @@ class Tournament(BaseModel): return True if self.has_started(): return True + if self.will_start_soon(1): + return True return False def has_team_registrations(self): @@ -927,6 +931,8 @@ class Tournament(BaseModel): return self.has_summons() if self.has_started(): return self.has_summons() + if self.will_start_soon(1): + return True return False def display_group_stages(self): @@ -2090,6 +2096,11 @@ class Tournament(BaseModel): def localized_start_time(self): return formats.date_format(self.local_start_date(), format='H:i').capitalize() + def court_names(self): + if self.event.club is None: + return [f"Piste {i+1}" for i in range(self.court_count)] + return [f"{self.event.club.court_name(i)}" for i in range(self.court_count)] + class MatchGroup: def __init__(self, name, matches, formatted_schedule, round_id=None, round_index=None): self.name = name diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_planning.html b/tournaments/templates/tournaments/broadcast/broadcasted_planning.html index fbd64cc..0a4ab78 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_planning.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_planning.html @@ -151,6 +151,7 @@ has_sponsors: {{ tournament.has_sponsors|lower }}, matchGroups: [], courtCount: {{ tournament.court_count|default:1 }}, + courtNames: {{ tournament.court_names }}, retrieveData() { fetch('/tournament/{{ tournament.id }}/planning/json/') .then(res => res.json()) @@ -211,10 +212,9 @@ return paginatedGroups; }, - getCourtNumber(courtName) { - if (!courtName) return 999; - const match = courtName.match(/(\d+)/); - return match ? parseInt(match[1]) : 999; + getCourtNumber(courtIndex) { + if (!courtIndex) return 999; + return courtIndex; }, organizeMatchesByCourt(matches) { @@ -222,7 +222,7 @@ if (matches && matches.length > 0) { matches.forEach(match => { if (match && match.court) { - const courtNum = this.getCourtNumber(match.court); + const courtNum = this.getCourtNumber(match.court_index); if (courtNum > 0 && courtNum <= this.courtCount) { courtMatches[courtNum - 1] = match; } @@ -289,10 +289,10 @@

00:00

-