diff --git a/tournaments/models/tournament.py b/tournaments/models/tournament.py index a1f7e21..d513713 100644 --- a/tournaments/models/tournament.py +++ b/tournaments/models/tournament.py @@ -444,7 +444,7 @@ class Tournament(models.Model): # if now is before the first match, we want to show the summons + group stage or first matches # change timezone to datetime to avoid the bug RuntimeWarning: DateTimeField Tournament.start_date received a naive datetime (2024-05-16 00:00:00) while time zone support is active. - if datetime.now().date() < self.start_date.date(): + if timezone.now() < self.start_date: team_summons_dicts = [summon.to_dict() for summon in self.team_summons()] if group_stages: return { @@ -660,13 +660,20 @@ class Tournament(models.Model): first_match_start_date = self.first_match_start_date(bracket_matches) if first_match_start_date is None: - return datetime.now().date() >= self.start_date.date() + return timezone.now() >= self.start_date bracket_start_date = self.getEightAm(first_match_start_date) + if bracket_start_date < self.start_date: bracket_start_date = self.start_date - if datetime.now().date() >= bracket_start_date.date(): + group_stage_start_date = self.group_stage_start_date() + if group_stage_start_date is not None: + if bracket_start_date < group_stage_start_date: + return False + + + if timezone.now() >= bracket_start_date: return True return False @@ -685,7 +692,7 @@ class Tournament(models.Model): return min(matches, key=lambda m: m.start_date).start_date def getEightAm(self, date): - return date.replace(hour=8, minute=0, second=0, microsecond=0) + return date.replace(hour=8, minute=0, second=0, microsecond=0, tzinfo=date.tzinfo) def supposedly_in_progress(self): end = self.start_date + timedelta(days=self.day_duration + 1) diff --git a/tournaments/static/tournaments/css/broadcast.css b/tournaments/static/tournaments/css/broadcast.css index ffd1f78..1100a31 100644 --- a/tournaments/static/tournaments/css/broadcast.css +++ b/tournaments/static/tournaments/css/broadcast.css @@ -22,6 +22,19 @@ body { box-shadow: 0 0 0px 0px #fbead6; } +.headerbubble { + padding: 20px; + background-color: white; + border-radius: 24px; + box-shadow: 0 0 0px 0px #fbead6; + display: inline-block; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + max-width: 120%; /* Allow bubble to take full width */ + box-sizing: border-box; /* Include padding in the width calculation */ +} + .bold { font-family: "Montserrat-Bold"; } diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_auto.html b/tournaments/templates/tournaments/broadcast/broadcasted_auto.html index 6888cc7..3712a83 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_auto.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_auto.html @@ -98,7 +98,7 @@
-
+