Implement standings freezing
This commit is contained in:
@@ -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()
|
||||
});
|
||||
});
|
||||
|
@@ -105,6 +105,12 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="right form-actions">
|
||||
#if(!$tour.frozen && $round == $tour.rounds)
|
||||
<button id="freeze" class="ui orange floating right labeled icon button">
|
||||
<i class="snowflake plane outline icon"></i>
|
||||
Freeze
|
||||
</button>
|
||||
#end
|
||||
<button id="publish" class="ui yellow floating right labeled icon button">
|
||||
<i class="paper plane outline icon"></i>
|
||||
Publish
|
||||
|
Reference in New Issue
Block a user