fix tournament info url detection and add format in match cells improve rankings broadcast screen

bracket-feature
Raz 9 months ago
parent 5eda86330a
commit d297a4c78a
  1. 20
      tournaments/models/enums.py
  2. 8
      tournaments/models/match.py
  3. 10
      tournaments/static/tournaments/css/style.css
  4. 10
      tournaments/templates/tournaments/broadcast/broadcasted_match.html
  5. 10
      tournaments/templates/tournaments/broadcast/broadcasted_ranking.html
  6. 10
      tournaments/templates/tournaments/match_cell.html
  7. 3
      tournaments/templates/tournaments/tournament_info.html

@ -96,6 +96,26 @@ class FederalMatchCategory(models.IntegerChoices):
SINGLE_SET_OF_FOUR_GAMES = 13, 'Single set of four games'
SINGLE_SET_OF_FOUR_GAMES_DECISIVE_POINT = 14, 'Single set of four games with decisive point'
@property
def format_label_short(self):
format_mapping = {
self.TWO_SETS: "A1",
self.TWO_SETS_SUPER_TIE: "B1",
self.TWO_SETS_FOUR_GAME: "C1",
self.NINE_GAMES: "D1",
self.SUPER_TIE: "E",
self.TWO_SETS_OF_SUPER_TIE: "G",
self.MEGA_TIE: "F",
self.SINGLE_SET: "H1",
self.SINGLE_SET_DECISIVE_POINT: "H2",
self.TWO_SETS_DECISIVE_POINT: "A2",
self.TWO_SETS_DECISIVE_POINT_SUPER_TIE: "B2",
self.TWO_SETS_FOUR_GAME_DECISIVE_POINT: "C2",
self.NINE_GAMES_DECISIVE_POINT: "D2",
self.SINGLE_SET_OF_FOUR_GAMES: "I1"
}
return format_mapping.get(self, "")
def last_set_is_tie_break(value):
if value == FederalMatchCategory.TWO_SETS_FOUR_GAME or value == FederalMatchCategory.TWO_SETS_FOUR_GAME_DECISIVE_POINT or value == FederalMatchCategory.TWO_SETS_SUPER_TIE or value == FederalMatchCategory.SUPER_TIE or value == FederalMatchCategory.MEGA_TIE or value == FederalMatchCategory.TWO_SETS_DECISIVE_POINT_SUPER_TIE:
return True

@ -318,7 +318,9 @@ class Match(models.Model):
group_stage_name = self.group_stage.display_name()
ended = self.end_date is not None
livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name)
live_format = "Format " + FederalMatchCategory(self.format).format_label_short
livematch = LiveMatch(title, date, time_indication, court, self.started(), ended, group_stage_name, live_format)
for team in self.live_teams():
livematch.add_team(team)
@ -369,7 +371,7 @@ class Team:
}
class LiveMatch:
def __init__(self, title, date, time_indication, court, started, ended, group_stage_name):
def __init__(self, title, date, time_indication, court, started, ended, group_stage_name, format):
self.title = title
self.date = date
self.teams = []
@ -379,6 +381,7 @@ class LiveMatch:
self.ended = ended
self.has_walk_out = False
self.group_stage_name = group_stage_name
self.format = format
def add_team(self, team):
self.teams.append(team)
@ -396,6 +399,7 @@ class LiveMatch:
"ended": self.ended,
"has_walk_out": self.has_walk_out,
"group_stage_name": self.group_stage_name,
"format": self.format
}
def show_time_indication(self):

@ -246,6 +246,7 @@ tr {
font-family: "Anybody-ExtraBold";
font-size: 1.2em;
color: #1b223a;
line-height: 24px; /* Match the height of flex-row */
}
.title {
@ -816,3 +817,12 @@ h-margin {
.group-stage-link:hover {
color: #f39200; /* Or whatever hover color you prefer */
}
.tournament-info a {
color: #f39200;
text-decoration: underline;
font-weight: bold;
}
.tournament-info a:hover {
color: #f39200;
}

@ -2,9 +2,13 @@
<div class="flex-row">
<label class="left-label matchtitle">
<span x-text="match.group_stage_name"></span><span x-show="match.group_stage_name"> :</span> <span x-text="match.title"></span>
<span x-text="match.group_stage_name"></span>
<span x-show="match.group_stage_name"> :</span>
<span x-text="match.title"></span>
</label>
<!-- <label class="right-label info"><span x-text="match.date"></span></label> -->
<label class="right-label minor-info bold" x-show="match.ended === false">
<span x-text="match.court"></span>
</label>
</div>
<template x-for="i in match.teams.length">
@ -59,7 +63,7 @@
<div class="top-margin flex-row">
<label class="left-label minor-info bold"><span x-text="match.time_indication"></span></label>
<label class="right-label minor-info semibold"><span x-text="match.court"></span></label>
<label class="right-label minor-info semibold"><span x-text="match.format"></span></label>
</div>
</div>

@ -3,7 +3,11 @@
<div>
<div class="table-row-3-colums-ranks">
<div class="table-cell"><div class="mybox center"><span x-text="ranking.formatted_ranking"></div></div>
<div class="table-cell">
<div class="mybox center">
<span style="font-size: 1.4em;" x-text="ranking.formatted_ranking"></span>
</div>
</div>
<div class="table-cell table-cell-large padding-left semibold">
<template x-for="name in ranking.names" >
@ -11,7 +15,9 @@
</template>
</div>
{% if tournament.display_points_earned %}
<div class="table-cell right horizontal-padding numbers"><span x-text="ranking.points"></div>
<div class="table-cell right horizontal-padding numbers">
<span style="font-size: 1.4em;" x-text="ranking.points"></span>
</div>
{% endif %}
</div>
<div x-show="index < column.length - 1">

@ -3,10 +3,12 @@
<div class="cell medium-12 large-3 my-block">
<div class="bubble">
<!-- <div class="flex-row"> -->
<div class="flex-row">
<label class="matchtitle">{{ match.title }}</label>
<!-- <label class="right-label info">{{ match.date }}</label> -->
<!-- </div> -->
{% if not match.ended %}
<label class="right-label minor-info bold">{{ match.court }}</label>
{% endif %}
</div>
<div>
@ -62,7 +64,7 @@
</label>
<label class="right-label minor-info">
{% if not match.ended %}
{{ match.court }}
{{ match.format }}
{% endif %}
</label>
<!-- <a href="" class="right-label">{{ match.court }}</a> -->

@ -99,7 +99,8 @@
{% if tournament.information %}
<p>
<div class="semibold">Infos</div>
<div>{{ tournament.information|linebreaksbr }}</div>
<div class="tournament-info">
{{ tournament.information|linebreaksbr|urlize }}</div>
</p>
{% endif %}

Loading…
Cancel
Save