Merge branch 'main' into timetoconfirm

timetoconfirm
Raz 7 months ago
commit 185aa29f3d
  1. 14
      tournaments/models/match.py
  2. 9
      tournaments/static/tournaments/css/tournament_bracket.css
  3. 2
      tournaments/templates/tournaments/bracket_match_cell.html
  4. 6
      tournaments/templates/tournaments/broadcast/broadcasted_bracket.html
  5. 2
      tournaments/templates/tournaments/broadcast/broadcasted_match.html
  6. 2
      tournaments/templates/tournaments/match_cell.html

@ -434,7 +434,7 @@ class Match(SideStoreModel):
ended = self.end_date is not None
live_format = "Format " + FederalMatchCategory(self.format).format_label_short
livematch = LiveMatch(self.index, title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled, bracket_name)
livematch = LiveMatch(self.index, title, date, time_indication, court, self.started(), ended, group_stage_name, live_format, self.start_date, self.court_index, self.disabled, bracket_name, self.should_show_lucky_loser_status())
for team in self.live_teams():
livematch.add_team(team)
@ -447,6 +447,12 @@ class Match(SideStoreModel):
else:
return self.team_scores.order_by('team_registration__bracket_position')
def should_show_lucky_loser_status(self):
if self.group_stage is not None:
return False
if self.round and self.round.parent is None and self.round.group_stage_loser_bracket is False:
return True
return False
# def non_null_start_date(self):
# if self.start_date:
# return self.start_date
@ -495,7 +501,7 @@ class Team:
}
class LiveMatch:
def __init__(self, index, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled, bracket_name):
def __init__(self, index, title, date, time_indication, court, started, ended, group_stage_name, format, start_date, court_index, disabled, bracket_name, should_show_lucky_loser_status):
self.index = index
self.title = title
self.date = date
@ -511,6 +517,7 @@ class LiveMatch:
self.start_date = start_date
self.court_index = court_index
self.bracket_name = bracket_name
self.should_show_lucky_loser_status = should_show_lucky_loser_status
def add_team(self, team):
self.teams.append(team)
@ -532,7 +539,8 @@ class LiveMatch:
"format": self.format,
"disabled": self.disabled,
"court_index": self.court_index,
"bracket_name": self.bracket_name
"bracket_name": self.bracket_name,
"should_show_lucky_loser_status": self.should_show_lucky_loser_status,
}
def show_time_indication(self):

@ -54,9 +54,18 @@
}
.round-title.broadcast-mode {
font-size: 0.9em;
width: auto; /* Change from 100% to auto */
}
.match-result.broadcast-mode {
padding: 4px;
}
.score.broadcast-mode {
font-size: 1em;
}
.round-name {
color: #505050;
font-size: 1.5em;

@ -23,7 +23,7 @@
{% if team.is_lucky_loser or team.walk_out == 1 %}
<div class="overlay-text">
{% if team.is_lucky_loser %}(LL){% elif team.walk_out == 1 %}(WO){% endif %}
{% if match.should_show_lucky_loser_status and team.is_lucky_loser %}(LL){% elif team.walk_out == 1 %}(WO){% endif %}
</div>
{% endif %}

@ -67,10 +67,8 @@
// Generate HTML for each team
match.teams.forEach((team, teamIndex) => {
html += `
<div class="match-result ${teamIndex === 0 ? 'bottom-border' : ''}">
<div class="match-result broadcast-mode ${teamIndex === 0 ? 'bottom-border' : ''}">
<div class="player ${team.names.length === 1 ? 'single-player' : 'two-players'}">
${team.is_lucky_loser ? '<div class="overlay-text">(LL)</div>' : ''}
${team.walk_out === 1 ? '<div class="overlay-text">(WO)</div>' : ''}
${team.names.map(name => `
<div class="semibold ${team.walk_out === 1 ? 'strikethrough' : ''} ${team.is_winner ? 'winner' : ''}">
@ -95,7 +93,7 @@
` : ''}
${team.weight && !match.has_walk_out && (!team.scores || team.scores.length === 0) ? `
<span class="score ws numbers">${team.weight}</span>
<span class="score ws numbers broadcast-mode">${team.weight}</span>
` : ''}
</div>
`;

@ -21,7 +21,7 @@
'two-players': match.teams[i-1].names.length === 2
}">
<!-- Show lucky loser or walkout status -->
<template x-if="match.teams[i-1].is_lucky_loser">
<template x-if="match.should_show_lucky_loser_status && match.teams[i-1].is_lucky_loser">
<div class="overlay-text right-label minor-info semibold">(LL)</div>
</template>
<template x-if="match.teams[i-1].walk_out === 1">

@ -21,7 +21,7 @@
{% if team.is_lucky_loser or team.walk_out == 1 %}
<div class="overlay-text">
{% if team.is_lucky_loser %}(LL){% elif team.walk_out == 1 %}(WO){% endif %}
{% if match.should_show_lucky_loser_status and team.is_lucky_loser %}(LL){% elif team.walk_out == 1 %}(WO){% endif %}
</div>
{% endif %}

Loading…
Cancel
Save