1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2025-06-22 22:38:24 +02:00

Add continue button for the final tournament

Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
Emmy D'Anello
2023-03-26 11:08:03 +02:00
parent 1bd9cea458
commit 7d8975339e
6 changed files with 156 additions and 52 deletions

View File

@ -32,6 +32,10 @@ function exportDraw(tid) {
sockets[tid].send(JSON.stringify({'type': 'export'}))
}
function continueFinal(tid) {
sockets[tid].send(JSON.stringify({'type': 'continue_final'}))
}
function showNotification(title, body, timeout = 5000) {
let notif = new Notification(title, {'body': body, 'icon': "/static/tfjm.svg"})
if (timeout)
@ -151,6 +155,14 @@ document.addEventListener('DOMContentLoaded', () => {
div.classList.add('d-none')
}
function updateContinueVisibility(visible) {
let div = document.getElementById(`continue-${tournament.id}`)
if (visible)
div.classList.remove('d-none')
else
div.classList.add('d-none')
}
function updatePoules(round, poules) {
let roundList = document.getElementById(`recap-${tournament.id}-round-list`)
let poolListId = `recap-${tournament.id}-round-${round}-pool-list`
@ -508,6 +520,9 @@ document.addEventListener('DOMContentLoaded', () => {
case 'export_visibility':
updateExportVisibility(data.visible)
break
case 'continue_visibility':
updateContinueVisibility(data.visible)
break
case 'set_poules':
updatePoules(data.round, data.poules)
break