fix broadcast stuff

sync_v2
Raz 6 months ago
parent 44776a0e1b
commit aaebde94b1
  1. 2
      tournaments/static/tournaments/css/broadcast.css
  2. 8
      tournaments/templates/tournaments/broadcast/broadcasted_auto.html
  3. 8
      tournaments/templates/tournaments/broadcast/broadcasted_auto_event.html
  4. 16
      tournaments/templates/tournaments/broadcast/broadcasted_planning.html
  5. 4
      tournaments/templates/tournaments/broadcast/broadcasted_rankings.html
  6. 4
      tournaments/templates/tournaments/broadcast/broadcasted_summons.html

@ -177,7 +177,6 @@ body {
} }
#header { #header {
margin-top: 20px;
margin-bottom: 40px; margin-bottom: 40px;
} }
.footer-broadcast { .footer-broadcast {
@ -193,7 +192,6 @@ body {
} }
#header { #header {
margin-top: 40px;
margin-bottom: 80px; margin-bottom: 80px;
} }
.footer-broadcast { .footer-broadcast {

@ -59,12 +59,12 @@
}, },
paginateSummons(array) { paginateSummons(array) {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }
@ -86,12 +86,12 @@
}, },
paginateRankings(array) { paginateRankings(array) {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }

@ -86,12 +86,12 @@
paginateSummons(array) { paginateSummons(array) {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }
@ -114,12 +114,12 @@
paginateRankings(array) { paginateRankings(array) {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }

@ -148,10 +148,9 @@
days: [], days: [],
currentDayIndex: 0, currentDayIndex: 0,
currentPageIndex: 0, currentPageIndex: 0,
has_sponsors: {{ tournament.has_sponsors|lower }},
matchGroups: [], matchGroups: [],
courtCount: {{ tournament.court_count|default:1 }}, courtCount: {{ tournament.court_count|default:1 }},
groupsPerPage: 6,
retrieveData() { retrieveData() {
fetch('/tournament/{{ tournament.id }}/planning/json/') fetch('/tournament/{{ tournament.id }}/planning/json/')
.then(res => res.json()) .then(res => res.json())
@ -167,13 +166,24 @@
}, },
getMatchGroupsForDay(day) { 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 formattedDay = day;
const filteredGroups = this.matchGroups.filter(group => { const filteredGroups = this.matchGroups.filter(group => {
if (!group.matches || group.matches.length === 0) return false; if (!group.matches || group.matches.length === 0) return false;
return group.name && formattedDay && group.name.includes(formattedDay); 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 let columns = this.courtCount >= 5 ? 1 : 2; // Number of columns to display
const paginatedGroups = []; const paginatedGroups = [];

@ -29,12 +29,12 @@
.then((data) => { .then((data) => {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }

@ -29,12 +29,12 @@
.then((data) => { .then((data) => {
let pageSize = 16 let pageSize = 16
if (window.innerHeight < 768) { if (window.innerHeight <= 720) {
pageSize = 12; pageSize = 12;
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 10 pageSize = 10
} }
} else if (window.innerHeight < 1024) { } else if (window.innerHeight <= 1080) {
if (this.has_sponsors) { if (this.has_sponsors) {
pageSize = 12 pageSize = 12
} }

Loading…
Cancel
Save