diff --git a/tournaments/models/match.py b/tournaments/models/match.py index ea70838..a422a72 100644 --- a/tournaments/models/match.py +++ b/tournaments/models/match.py @@ -389,7 +389,7 @@ class Match(models.Model): ended = self.end_date is not None live_format = "Format " + FederalMatchCategory(self.format).format_label_short - livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name, live_format) + livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index) for team in self.live_teams(): livematch.add_team(team) @@ -446,7 +446,7 @@ class Team: } class LiveMatch: - def __init__(self, title, date, time_indication, court, started, ended, group_stage_name, format): + def __init__(self, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index): self.title = title self.date = date self.teams = [] @@ -457,6 +457,8 @@ class LiveMatch: self.has_walk_out = False self.group_stage_name = group_stage_name self.format = format + self.start_date = start_date + self.court_index = court_index def add_team(self, team): self.teams.append(team) @@ -474,7 +476,9 @@ class LiveMatch: "ended": self.ended, "has_walk_out": self.has_walk_out, "group_stage_name": self.group_stage_name, - "format": self.format + "format": self.format, + "start_date": self.start_date, + "court_index": self.court_index } def show_time_indication(self): diff --git a/tournaments/templates/tournaments/prog.html b/tournaments/templates/tournaments/prog.html new file mode 100644 index 0000000..44baf45 --- /dev/null +++ b/tournaments/templates/tournaments/prog.html @@ -0,0 +1,40 @@ +{% extends 'tournaments/base.html' %} + +{% block head_title %}Matchs du {{ tournament.display_name }}{% endblock %} +{% block first_title %}{{ tournament.event.display_name }}{% endblock %} +{% block second_title %}{{ tournament.display_name }}{% endblock %} + +{% if tournament.display_matches %} +{% block content %} + +{% include 'tournaments/navigation_tournament.html' %} + +{% if tournament.display_matches or tournament.display_group_stages %} + + {% regroup match_groups.matches by start_date|date:"l d F Y" as matches_by_date %} + + {% for date in matches_by_date %} + + {% regroup date.list by start_date|date:"H:i" as matches_by_hour %} + + {% for hour_group in matches_by_hour %} +