|
|
|
@ -10,6 +10,12 @@ |
|
|
|
<link rel="stylesheet" href="{% static 'tournaments/css/style.css' %}" /> |
|
|
|
<link rel="stylesheet" href="{% static 'tournaments/css/style.css' %}" /> |
|
|
|
<link rel="stylesheet" href="{% static 'tournaments/css/broadcast.css' %}" /> |
|
|
|
<link rel="stylesheet" href="{% static 'tournaments/css/broadcast.css' %}" /> |
|
|
|
<style> |
|
|
|
<style> |
|
|
|
|
|
|
|
.bubble { |
|
|
|
|
|
|
|
padding: 10px; |
|
|
|
|
|
|
|
background-color: white; |
|
|
|
|
|
|
|
border-radius: 24px; |
|
|
|
|
|
|
|
box-shadow: 0 0 0px 0px #fbead6; |
|
|
|
|
|
|
|
} |
|
|
|
.running { |
|
|
|
.running { |
|
|
|
background-color: #90ee90 !important; |
|
|
|
background-color: #90ee90 !important; |
|
|
|
} |
|
|
|
} |
|
|
|
@ -46,6 +52,9 @@ |
|
|
|
background-color: rgba(173, 216, 230, 0.3); |
|
|
|
background-color: rgba(173, 216, 230, 0.3); |
|
|
|
color: white; |
|
|
|
color: white; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.match-cell .bubble.ended { |
|
|
|
|
|
|
|
background-color: rgba(173, 216, 230, 0.3); |
|
|
|
|
|
|
|
} |
|
|
|
.court-label { |
|
|
|
.court-label { |
|
|
|
box-sizing: border-box; |
|
|
|
box-sizing: border-box; |
|
|
|
padding: 0; |
|
|
|
padding: 0; |
|
|
|
@ -165,10 +174,29 @@ |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
let groupsPerPageThreshold = this.courtCount >= 5 ? Math.ceil(this.groupsPerPage / 2) : this.groupsPerPage; |
|
|
|
let groupsPerPageThreshold = this.courtCount >= 5 ? Math.ceil(this.groupsPerPage / 2) : this.groupsPerPage; |
|
|
|
|
|
|
|
let columns = this.courtCount >= 5 ? 1 : 2; // Number of columns to display |
|
|
|
|
|
|
|
|
|
|
|
const paginatedGroups = []; |
|
|
|
const paginatedGroups = []; |
|
|
|
for (let i = 0; i < Math.ceil(filteredGroups.length / groupsPerPageThreshold); i++) { |
|
|
|
for (let i = 0; i < Math.ceil(filteredGroups.length / groupsPerPageThreshold); i++) { |
|
|
|
paginatedGroups.push(filteredGroups.slice(i * groupsPerPageThreshold, (i + 1) * groupsPerPageThreshold)); |
|
|
|
// For each page |
|
|
|
|
|
|
|
const pageGroups = filteredGroups.slice(i * groupsPerPageThreshold, (i + 1) * groupsPerPageThreshold); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Rearrange groups in vertical order |
|
|
|
|
|
|
|
if (columns === 2) { |
|
|
|
|
|
|
|
const rearrangedGroups = []; |
|
|
|
|
|
|
|
const halfPageLength = Math.ceil(pageGroups.length / 2); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Create groups with alternating order: [0, halfPageLength, 1, halfPageLength+1, ...] |
|
|
|
|
|
|
|
for (let col = 0; col < halfPageLength; col++) { |
|
|
|
|
|
|
|
rearrangedGroups.push(pageGroups[col]); // First column |
|
|
|
|
|
|
|
if (col + halfPageLength < pageGroups.length) { |
|
|
|
|
|
|
|
rearrangedGroups.push(pageGroups[col + halfPageLength]); // Second column |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
paginatedGroups.push(rearrangedGroups); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
paginatedGroups.push(pageGroups); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return paginatedGroups; |
|
|
|
return paginatedGroups; |
|
|
|
}, |
|
|
|
}, |
|
|
|
@ -230,7 +258,7 @@ |
|
|
|
}" x-init="loop()"> |
|
|
|
}" x-init="loop()"> |
|
|
|
|
|
|
|
|
|
|
|
<header> |
|
|
|
<header> |
|
|
|
<div id="header"> |
|
|
|
<div id="header" class="header-broadcast"> |
|
|
|
<div class="left-content bubble-header"> |
|
|
|
<div class="left-content bubble-header"> |
|
|
|
<img src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" alt="logo" class="logo"> |
|
|
|
<img src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" alt="logo" class="logo"> |
|
|
|
<div class="left-margin"> |
|
|
|
<div class="left-margin"> |
|
|
|
@ -250,7 +278,7 @@ |
|
|
|
<div class="bubble-timeslot" style="visibility: hidden; align-items: center; justify-content: center; margin-right: 10px; width: 6vw;"> |
|
|
|
<div class="bubble-timeslot" style="visibility: hidden; align-items: center; justify-content: center; margin-right: 10px; width: 6vw;"> |
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="courts-row"> |
|
|
|
<div class="courts-row" style="margin-left: 10px; margin-bottom: -10px;"> |
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<div class="bubble"> |
|
|
|
<div class="bubble"> |
|
|
|
@ -266,7 +294,7 @@ |
|
|
|
<div class="bubble-timeslot" style="visibility: hidden; align-items: center; justify-content: center; margin-right: 10px; width: 6vw;"> |
|
|
|
<div class="bubble-timeslot" style="visibility: hidden; align-items: center; justify-content: center; margin-right: 10px; width: 6vw;"> |
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
<div class="courts-row"> |
|
|
|
<div class="courts-row" style="margin-bottom: -10px;"> |
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<div class="bubble"> |
|
|
|
<div class="bubble"> |
|
|
|
@ -280,7 +308,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
|
<template x-for="(day, dayIndex) in days" :key="day"> |
|
|
|
<template x-for="(day, dayIndex) in days" :key="day"> |
|
|
|
<div x-show="currentDayIndex === dayIndex"> |
|
|
|
<div class="padding10" x-show="currentDayIndex === dayIndex"> |
|
|
|
<template x-for="(groupPage, pageIndex) in getMatchGroupsForDay(day)" :key="'page-' + pageIndex"> |
|
|
|
<template x-for="(groupPage, pageIndex) in getMatchGroupsForDay(day)" :key="'page-' + pageIndex"> |
|
|
|
<div x-show="currentPageIndex === pageIndex"> |
|
|
|
<div x-show="currentPageIndex === pageIndex"> |
|
|
|
<div class="grid-x"> |
|
|
|
<div class="grid-x"> |
|
|
|
@ -295,11 +323,12 @@ |
|
|
|
<template x-for="(match, courtIndex) in organizeMatchesByCourt(group.matches)" :key="courtIndex"> |
|
|
|
<template x-for="(match, courtIndex) in organizeMatchesByCourt(group.matches)" :key="courtIndex"> |
|
|
|
<div class="match-cell" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<div class="match-cell" :style="{'width': calculateFractionWidth()}"> |
|
|
|
<template x-if="match"> |
|
|
|
<template x-if="match"> |
|
|
|
<div class="bubble" :class="{'running': !match.ended && match.started, 'even': courtIndex % 2 === 1, 'empty': match.ended}" style="text-align: center;"> |
|
|
|
<div class="bubble" :class="{'running': !match.ended && match.started, 'even': courtIndex % 2 === 1, 'ended': match.ended}" style="text-align: center;"> |
|
|
|
<div class="bold" x-text="match.group_stage_name ? match.group_stage_name : match.title"></div> |
|
|
|
|
|
|
|
<template x-if="match.tournament_title"> |
|
|
|
<template x-if="match.tournament_title"> |
|
|
|
<div class="minor-info semibold" x-text="match.tournament_title"></div> |
|
|
|
<div class="minor-info semibold" x-text="match.tournament_title"></div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
<div class="bold" x-text="match.group_stage_name ? match.group_stage_name : match.title"></div> |
|
|
|
|
|
|
|
<div class="minor-info" x-text="match.format"></div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
<template x-if="!match"> |
|
|
|
<template x-if="!match"> |
|
|
|
|