mirror of
https://gitlab.com/animath/si/plateforme.git
synced 2025-06-22 22:38:24 +02:00
Add cancel button to cancel the last step (works for the last problem acceptance for now)
Signed-off-by: Emmy D'Anello <emmy.danello@animath.fr>
This commit is contained in:
@ -20,6 +20,15 @@ function abortDraw(tid) {
|
||||
sockets[tid].send(JSON.stringify({'type': 'abort'}))
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to cancel the last step.
|
||||
* Only volunteers are allowed to do this.
|
||||
* @param tid The tournament id
|
||||
*/
|
||||
function cancelLastStep(tid) {
|
||||
sockets[tid].send(JSON.stringify({'type': 'cancel'}))
|
||||
}
|
||||
|
||||
/**
|
||||
* Request to launch a dice between 1 and 100, for the two first steps.
|
||||
* The parameter `trigram` can be specified (by volunteers) to launch a dice for a specific team.
|
||||
@ -583,13 +592,19 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
function setProblemAccepted(round, team, problem) {
|
||||
// Update recap
|
||||
let recapDiv = document.getElementById(`recap-${tournament.id}-round-${round}-team-${team}-accepted`)
|
||||
recapDiv.classList.remove('text-bg-warning')
|
||||
recapDiv.classList.add('text-bg-success')
|
||||
recapDiv.textContent = `${team} 📃 ${problem}`
|
||||
if (problem !== null) {
|
||||
recapDiv.classList.remove('text-bg-warning')
|
||||
recapDiv.classList.add('text-bg-success')
|
||||
}
|
||||
else {
|
||||
recapDiv.classList.add('text-bg-warning')
|
||||
recapDiv.classList.remove('text-bg-success')
|
||||
}
|
||||
recapDiv.textContent = `${team} 📃 ${problem ? problem : '?'}`
|
||||
|
||||
// Update table
|
||||
let tableSpan = document.getElementById(`table-${tournament.id}-round-${round}-problem-${team}`)
|
||||
tableSpan.textContent = problem
|
||||
tableSpan.textContent = problem ? problem : '?'
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user