Laurent 2 years ago
parent 1fc3537149
commit 51209e0f87
  1. 16
      tournaments/templates/tournaments/broadcasted_summons.html

@ -16,12 +16,14 @@
fetch('/tournament/{{ tournament.id }}/summons/json/') fetch('/tournament/{{ tournament.id }}/summons/json/')
.then(res => res.json()) .then(res => res.json())
.then((data) => { .then((data) => {
this.paginatedMatches = this.paginate(data, 16)
let pageSize = 20
this.paginatedMatches = this.paginate(data, pageSize)
const splitGroups = []; const splitGroups = [];
this.paginatedMatches.forEach(group => { this.paginatedMatches.forEach(group => {
const firstHalf = group.slice(0, 8); const firstHalf = group.slice(0, pageSize / 2);
const secondHalf = group.slice(8); const secondHalf = group.slice(pageSize / 2);
splitGroups.push([firstHalf, secondHalf]); splitGroups.push([firstHalf, secondHalf]);
}); });
this.paginatedMatches = splitGroups; this.paginatedMatches = splitGroups;
@ -50,8 +52,8 @@
<template x-for="i in paginatedMatches.length" > <template x-for="i in paginatedMatches.length" >
<template x-for="column in paginatedMatches[i-1]" > <template x-for="column in paginatedMatches[i-1]" >
<div class="cell medium-6 large-6 topblock my-block" x-show="active === i"> <div class="cell medium-6 large-6 topblock my-block" x-show="active === i">
<div class="bubble"> <template x-for="summon in column" >
<template x-for="summon in column" > <div class="bubble">
<div class="table-row-4-colums bottom-border"> <div class="table-row-4-colums bottom-border">
<div class="table-cell table-cell-large semibold"> <div class="table-cell table-cell-large semibold">
<template x-for="i in summon.names.length"> <template x-for="i in summon.names.length">
@ -63,8 +65,8 @@
<div class="table-cell large center"><span x-text="summon.date"></span></div> <div class="table-cell large center"><span x-text="summon.date"></span></div>
<div class="table-cell"><div class="mybox center"><span x-text="summon.stage"></span></div></div> <div class="table-cell"><div class="mybox center"><span x-text="summon.stage"></span></div></div>
</div> </div>
</template> </div>
</div> </template>
</div> </div>
</template> </template>
</template> </template>

Loading…
Cancel
Save