diff --git a/tournaments/static/tournaments/css/broadcast.css b/tournaments/static/tournaments/css/broadcast.css index bd96916..b02f07c 100644 --- a/tournaments/static/tournaments/css/broadcast.css +++ b/tournaments/static/tournaments/css/broadcast.css @@ -177,7 +177,6 @@ body { } #header { - margin-top: 20px; margin-bottom: 40px; } .footer-broadcast { @@ -193,7 +192,6 @@ body { } #header { - margin-top: 40px; margin-bottom: 80px; } .footer-broadcast { diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_auto.html b/tournaments/templates/tournaments/broadcast/broadcasted_auto.html index 11b6c54..3222ddf 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_auto.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_auto.html @@ -59,12 +59,12 @@ }, paginateSummons(array) { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 } @@ -86,12 +86,12 @@ }, paginateRankings(array) { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 } diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_auto_event.html b/tournaments/templates/tournaments/broadcast/broadcasted_auto_event.html index e346dd1..cf8a9f7 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_auto_event.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_auto_event.html @@ -86,12 +86,12 @@ paginateSummons(array) { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 } @@ -114,12 +114,12 @@ paginateRankings(array) { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 } diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_planning.html b/tournaments/templates/tournaments/broadcast/broadcasted_planning.html index cfc1c83..a8d60f2 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_planning.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_planning.html @@ -148,10 +148,9 @@ days: [], currentDayIndex: 0, currentPageIndex: 0, + has_sponsors: {{ tournament.has_sponsors|lower }}, matchGroups: [], courtCount: {{ tournament.court_count|default:1 }}, - groupsPerPage: 6, - retrieveData() { fetch('/tournament/{{ tournament.id }}/planning/json/') .then(res => res.json()) @@ -167,13 +166,24 @@ }, getMatchGroupsForDay(day) { + let groupsPerPage = 12; + if (window.innerHeight <=720) { + groupsPerPage = 8; + } else if (window.innerHeight <=1080) { + groupsPerPage = 10; + } + + if (this.has_sponsors) { + groupsPerPage = groupsPerPage - 2; + } + const formattedDay = day; const filteredGroups = this.matchGroups.filter(group => { if (!group.matches || group.matches.length === 0) return false; return group.name && formattedDay && group.name.includes(formattedDay); }); - let groupsPerPageThreshold = this.courtCount >= 5 ? Math.ceil(this.groupsPerPage / 2) : this.groupsPerPage; + let groupsPerPageThreshold = this.courtCount >= 5 ? Math.ceil(groupsPerPage / 2) : groupsPerPage; let columns = this.courtCount >= 5 ? 1 : 2; // Number of columns to display const paginatedGroups = []; diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_rankings.html b/tournaments/templates/tournaments/broadcast/broadcasted_rankings.html index 6ae549b..3cd2159 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_rankings.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_rankings.html @@ -29,12 +29,12 @@ .then((data) => { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 } diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_summons.html b/tournaments/templates/tournaments/broadcast/broadcasted_summons.html index 0f858ee..1bf3735 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_summons.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_summons.html @@ -29,12 +29,12 @@ .then((data) => { let pageSize = 16 - if (window.innerHeight < 768) { + if (window.innerHeight <= 720) { pageSize = 12; if (this.has_sponsors) { pageSize = 10 } - } else if (window.innerHeight < 1024) { + } else if (window.innerHeight <= 1080) { if (this.has_sponsors) { pageSize = 12 }