|
|
|
@ -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 = []; |
|
|
|
|