Implement standings freezing

This commit is contained in:
Claude Brisson
2024-08-20 11:48:29 +02:00
parent 15257028c0
commit bae30c7465
11 changed files with 98 additions and 54 deletions

View File

@@ -24,6 +24,16 @@ function publishHtml() {
close_modal();
}
function freeze() {
api.put(`tour/${tour_id}/standings/${activeRound}`, {}
).then(resp => {
if (resp.ok) {
document.location.reload();
}
else throw "freeze error"
}).catch(err => showError(err));
}
onLoad(() => {
new Tablesort($('#standings-table')[0]);
$('.criterium').on('click', e => {
@@ -86,4 +96,7 @@ onLoad(() => {
$('.publish-html').on('click', e => {
publishHtml();
});
$('#freeze').on('click', e => {
freeze()
});
});