|
|
|
@ -37,7 +37,7 @@ |
|
|
|
paginatedGroupStages: null, |
|
|
|
paginatedGroupStages: null, |
|
|
|
paginatedSummons: null, |
|
|
|
paginatedSummons: null, |
|
|
|
active: 1, |
|
|
|
active: 1, |
|
|
|
title: '', |
|
|
|
prefixTitle: '', |
|
|
|
retrieveData() { |
|
|
|
retrieveData() { |
|
|
|
fetch('/tournament/{{ tournament.id }}/broadcast/json/') |
|
|
|
fetch('/tournament/{{ tournament.id }}/broadcast/json/') |
|
|
|
.then(res => res.json()) |
|
|
|
.then(res => res.json()) |
|
|
|
@ -45,7 +45,7 @@ |
|
|
|
this.paginatedMatches = this.paginate(data.matches, 8) |
|
|
|
this.paginatedMatches = this.paginate(data.matches, 8) |
|
|
|
this.paginatedGroupStages = this.paginate(data.group_stages, 4) |
|
|
|
this.paginatedGroupStages = this.paginate(data.group_stages, 4) |
|
|
|
this.paginatedSummons = this.paginateSummons(data.summons) |
|
|
|
this.paginatedSummons = this.paginateSummons(data.summons) |
|
|
|
this.setTitle() |
|
|
|
this.setPrefixTitle() |
|
|
|
}) |
|
|
|
}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
paginateSummons(array) { |
|
|
|
paginateSummons(array) { |
|
|
|
@ -76,19 +76,19 @@ |
|
|
|
setInterval(() => { |
|
|
|
setInterval(() => { |
|
|
|
this.retrieveData() |
|
|
|
this.retrieveData() |
|
|
|
this.active = this.active === this.pageCount() ? 1 : this.active+1 |
|
|
|
this.active = this.active === this.pageCount() ? 1 : this.active+1 |
|
|
|
this.setTitle() |
|
|
|
this.setPrefixTitle() |
|
|
|
}, 15000) |
|
|
|
}, 15000) |
|
|
|
}, |
|
|
|
}, |
|
|
|
pageCount() { |
|
|
|
pageCount() { |
|
|
|
return this.paginatedMatches.length + this.paginatedGroupStages.length + this.paginatedSummons.length |
|
|
|
return this.paginatedMatches.length + this.paginatedGroupStages.length + this.paginatedSummons.length |
|
|
|
}, |
|
|
|
}, |
|
|
|
setTitle() { |
|
|
|
setPrefixTitle() { |
|
|
|
if (this.active < 1 + this.paginatedSummons.length) { |
|
|
|
if (this.active < 1 + this.paginatedSummons.length) { |
|
|
|
this.title = 'Convocations' |
|
|
|
this.prefixTitle = 'Convocations' |
|
|
|
} else if (this.active < 1 + this.paginatedSummons.length + this.paginatedMatches.length) { |
|
|
|
} else if (this.active < 1 + this.paginatedSummons.length + this.paginatedMatches.length) { |
|
|
|
this.title = 'Matchs' |
|
|
|
this.prefixTitle = 'Matchs' |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
this.title = 'Poules' |
|
|
|
this.prefixTitle = 'Poules' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -104,8 +104,8 @@ |
|
|
|
class="logo inline" |
|
|
|
class="logo inline" |
|
|
|
/> |
|
|
|
/> |
|
|
|
<div class="inline"> |
|
|
|
<div class="inline"> |
|
|
|
<h1 class="club">{{ tournament.display_name }}</h1> |
|
|
|
<h1 class="club">{{ tournament.broadcast_event_display_name }}</h1> |
|
|
|
<h1 class="event"><span x-text="title"></span></h1> |
|
|
|
<h1 class="event"><span x-text="prefixTitle"></span> {{ tournament.broadcast_display_name }}</h1> |
|
|
|
<!-- <span>Propulsé par Padel Club</span> --> |
|
|
|
<!-- <span>Propulsé par Padel Club</span> --> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|