Adds link to see group stages match

sync
Laurent 8 months ago
parent abc246595d
commit 21ce64d941
  1. 6
      tournaments/models/group_stage.py
  2. 4
      tournaments/templates/tournaments/group_stage_cell.html

@ -57,7 +57,7 @@ class GroupStage(SideStoreModel):
return [ts.match for ts in team_scores] # map(lambda ts: ts.match, team_scores) return [ts.match for ts in team_scores] # map(lambda ts: ts.match, team_scores)
def live_group_stages(self): 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 = {} 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) return len(matches) > 0 and all(match.end_date is not None for match in matches)
class LiveGroupStage: class LiveGroupStage:
def __init__(self, title, step, index): def __init__(self, id, title, step, index):
self.id = id
self.title = title self.title = title
self.teams = [] self.teams = []
self.start = None self.start = None
@ -194,6 +195,7 @@ class LiveGroupStage:
def to_dict(self): def to_dict(self):
return { return {
"id": self.id,
"title": self.title, "title": self.title,
"teams": [team.to_dict() for team in self.teams], "teams": [team.to_dict() for team in self.teams],
"duration": self.formatted_duration(), "duration": self.formatted_duration(),

@ -4,7 +4,9 @@
<div class="dark_bubble"> <div class="dark_bubble">
<div class="flex-row"> <div class="flex-row">
<label class="left-label matchtitle winner">{{ group_stage.title }}</label> <a href="{% url 'tournament' tournament.id %}?group_stage={{ group_stage.id }}">
<span class="left-label matchtitle winner">{{ group_stage.title }}</span>
</a>
<!-- <label class="right-label info">{{ match.date }}</label> --> <!-- <label class="right-label info">{{ match.date }}</label> -->
</div> </div>

Loading…
Cancel
Save