From 21ce64d9419d8bfe699bafbc958dd5054645df5f Mon Sep 17 00:00:00 2001 From: Laurent Date: Sat, 22 Mar 2025 15:11:19 +0100 Subject: [PATCH] Adds link to see group stages match --- tournaments/models/group_stage.py | 6 ++++-- tournaments/templates/tournaments/group_stage_cell.html | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tournaments/models/group_stage.py b/tournaments/models/group_stage.py index e51c5e0..02dbbf3 100644 --- a/tournaments/models/group_stage.py +++ b/tournaments/models/group_stage.py @@ -57,7 +57,7 @@ class GroupStage(SideStoreModel): return [ts.match for ts in team_scores] # map(lambda ts: ts.match, team_scores) def live_group_stages(self): - lgs = LiveGroupStage(self.display_name(), self.step, self.index) + lgs = LiveGroupStage(self.id, self.display_name(), self.step, self.index) gs_teams = {} @@ -165,7 +165,8 @@ class GroupStage(SideStoreModel): return len(matches) > 0 and all(match.end_date is not None for match in matches) class LiveGroupStage: - def __init__(self, title, step, index): + def __init__(self, id, title, step, index): + self.id = id self.title = title self.teams = [] self.start = None @@ -194,6 +195,7 @@ class LiveGroupStage: def to_dict(self): return { + "id": self.id, "title": self.title, "teams": [team.to_dict() for team in self.teams], "duration": self.formatted_duration(), diff --git a/tournaments/templates/tournaments/group_stage_cell.html b/tournaments/templates/tournaments/group_stage_cell.html index f97a9e5..36eb63c 100644 --- a/tournaments/templates/tournaments/group_stage_cell.html +++ b/tournaments/templates/tournaments/group_stage_cell.html @@ -4,7 +4,9 @@
- + + {{ group_stage.title }} +