|
|
|
|
@ -36,6 +36,7 @@ |
|
|
|
|
paginatedMatches: null, |
|
|
|
|
paginatedGroupStages: null, |
|
|
|
|
paginatedSummons: null, |
|
|
|
|
paginatedRankings: null, |
|
|
|
|
active: 1, |
|
|
|
|
prefixTitle: '', |
|
|
|
|
retrieveData() { |
|
|
|
|
@ -45,11 +46,33 @@ |
|
|
|
|
this.paginatedMatches = this.paginate(data.matches, 8) |
|
|
|
|
this.paginatedGroupStages = this.paginate(data.group_stages, 4) |
|
|
|
|
this.paginatedSummons = this.paginateSummons(data.summons) |
|
|
|
|
this.paginatedRankings = this.paginateRankings(data.rankings) |
|
|
|
|
this.setPrefixTitle() |
|
|
|
|
|
|
|
|
|
// Adjust active if it exceeds the new page count |
|
|
|
|
if (this.active > this.pageCount()) { |
|
|
|
|
this.active = 1; // Reset to the first page |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
paginateSummons(array) { |
|
|
|
|
let pageSize = 20 |
|
|
|
|
let pageSize = 16 |
|
|
|
|
pages = this.paginate(array, pageSize) |
|
|
|
|
|
|
|
|
|
const splitGroups = [] |
|
|
|
|
pages.forEach(group => { |
|
|
|
|
const firstHalf = group.slice(0, pageSize / 2) |
|
|
|
|
const secondHalf = group.slice(pageSize / 2) |
|
|
|
|
if (secondHalf.length > 0) { |
|
|
|
|
splitGroups.push([firstHalf, secondHalf]) |
|
|
|
|
} else { |
|
|
|
|
splitGroups.push([firstHalf]) |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
return splitGroups |
|
|
|
|
}, |
|
|
|
|
paginateRankings(array) { |
|
|
|
|
let pageSize = 16 |
|
|
|
|
pages = this.paginate(array, pageSize) |
|
|
|
|
|
|
|
|
|
const splitGroups = [] |
|
|
|
|
@ -80,46 +103,39 @@ |
|
|
|
|
}, 15000) |
|
|
|
|
}, |
|
|
|
|
pageCount() { |
|
|
|
|
return this.paginatedMatches.length + this.paginatedGroupStages.length + this.paginatedSummons.length |
|
|
|
|
return this.paginatedMatches.length + this.paginatedGroupStages.length + this.paginatedSummons.length + this.paginatedRankings.length |
|
|
|
|
}, |
|
|
|
|
setPrefixTitle() { |
|
|
|
|
if (this.active < 1 + this.paginatedSummons.length) { |
|
|
|
|
this.prefixTitle = 'Convocations' |
|
|
|
|
} else if (this.active < 1 + this.paginatedSummons.length + this.paginatedMatches.length) { |
|
|
|
|
this.prefixTitle = 'Matchs' |
|
|
|
|
} else { |
|
|
|
|
} else if (this.active < 1 + this.paginatedSummons.length + this.paginatedMatches.length + this.paginatedGroupStages.length) { |
|
|
|
|
this.prefixTitle = 'Poules' |
|
|
|
|
} else { |
|
|
|
|
this.prefixTitle = 'Classement' |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}" x-init="loop()"> |
|
|
|
|
|
|
|
|
|
<div class="wrapper"> |
|
|
|
|
<header> |
|
|
|
|
<div class="grid-x"> |
|
|
|
|
<div class="cell medium-6 large-6 topblock my-block"> |
|
|
|
|
<div id="header"> |
|
|
|
|
<div class="left-content bubble"> |
|
|
|
|
<img |
|
|
|
|
src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" |
|
|
|
|
class="logo inline" |
|
|
|
|
/> |
|
|
|
|
<div class="inline"> |
|
|
|
|
<img src="{% static 'tournaments/images/PadelClub_logo_512.png' %}" alt="logo" class="logo"> |
|
|
|
|
<div class="left-margin"> |
|
|
|
|
<h1 class="club">{{ tournament.broadcast_event_display_name }}</h1> |
|
|
|
|
<h1 class="event"><span x-text="prefixTitle"></span> {{ tournament.broadcast_display_name }}</h1> |
|
|
|
|
<!-- <span>Propulsé par Padel Club</span> --> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="cell medium-6 large-6 topblock my-block"> |
|
|
|
|
<div class="right"> |
|
|
|
|
{% qr_from_text qr_code_url options=qr_code_options %} |
|
|
|
|
</div> |
|
|
|
|
</div > |
|
|
|
|
</div> |
|
|
|
|
{% if qr_code_options %} |
|
|
|
|
<div class="right-content">{% qr_from_text qr_code_url options=qr_code_options %}</div> |
|
|
|
|
{% endif %} |
|
|
|
|
</div> |
|
|
|
|
</header> |
|
|
|
|
|
|
|
|
|
<main> |
|
|
|
|
|
|
|
|
|
<div class="wrapper"> |
|
|
|
|
<main> |
|
|
|
|
<div class="grid-x"> |
|
|
|
|
|
|
|
|
|
<template x-for="i in paginatedSummons.length"> |
|
|
|
|
@ -146,6 +162,13 @@ |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<template x-for="i in paginatedRankings.length"> |
|
|
|
|
<template x-for="column in paginatedRankings[i-1]"> |
|
|
|
|
<div class="cell medium-6 large-6 topblock my-block" x-show="active === i + paginatedSummons.length + paginatedMatches.length + paginatedGroupStages.length"> |
|
|
|
|
{% include 'tournaments/broadcast/broadcasted_ranking.html' %} |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</template> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
</main> |
|
|
|
|
|