|
|
|
@ -16,7 +16,16 @@ |
|
|
|
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(this.paginate(data, 16), 8) |
|
|
|
this.paginatedMatches = this.paginate(data, 8) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const splitGroups = []; |
|
|
|
|
|
|
|
this.paginatedMatches.forEach(group => { |
|
|
|
|
|
|
|
const firstHalf = group.slice(0, group.length / 2); |
|
|
|
|
|
|
|
const secondHalf = group.slice(group.length / 2); |
|
|
|
|
|
|
|
splitGroups.push([firstHalf, secondHalf]); |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
this.paginatedMatches = splitGroups; |
|
|
|
|
|
|
|
|
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
paginate(array, pageSize) { |
|
|
|
paginate(array, pageSize) { |
|
|
|
@ -39,6 +48,7 @@ |
|
|
|
|
|
|
|
|
|
|
|
<div class="grid-x padding-bottom"> |
|
|
|
<div class="grid-x padding-bottom"> |
|
|
|
<template x-for="i in paginatedMatches.length" > |
|
|
|
<template x-for="i in paginatedMatches.length" > |
|
|
|
|
|
|
|
<div x-show="active === i"> |
|
|
|
<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"> |
|
|
|
<div class="cell medium-6 large-6 topblock my-block"> |
|
|
|
<div class="bubble"> |
|
|
|
<div class="bubble"> |
|
|
|
@ -58,6 +68,7 @@ |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</template> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|