Add final ranking for superuser (ioi16 only)

This commit is contained in:
cuom1999 2022-12-28 14:38:32 -06:00
parent 6635c3ee99
commit 309b6298e2
16 changed files with 424 additions and 336 deletions

View file

@ -24,6 +24,7 @@
{% endif %}
{% if request.user.is_superuser and can_use_resolver %}
{{ make_tab_item('resolver', 'fa fa-check', url('resolver', contest.key), _('Resolver')) }}
{{ make_tab_item('final_ranking', 'fa fa-bar-chart', url('contest_final_ranking', contest.key), _('Final rankings')) }}
{% endif %}
{% if can_edit %}
{% if perms.judge.moss_contest and has_moss_api_key %}

View file

@ -118,8 +118,12 @@
var friend = $('#show-friends-checkbox').is(':checked');
var virtual = $('#show-virtual-checkbox').is(':checked');
$('#loading-gif').show();
var url = `{{url('contest_ranking_ajax', contest.key)}}?friend=${friend}&virtual=${virtual}`;
{% if page_type == 'final_ranking' %}
url += "&final=true";
{% endif %}
$.get({
url: `{{url('contest_ranking_ajax', contest.key)}}?friend=${friend}&virtual=${virtual}`,
url: url,
success: function(HTML) {
$('#users-table').html(HTML);
highlightFirstSolve();
@ -199,7 +203,8 @@
$('#show-virtual-label').hide();
{% else %}
{% if request.in_contest %}
setInterval(update_ranking, 60 * 1000);
clearInterval(window.rankingInterval);
window.rankingInterval = setInterval(update_ranking, 60 * 1000);
{% endif %}
{% endif %}
});

View file

@ -57,7 +57,7 @@
});
</script>
{% endif %}
{% if page_type == 'ranking' %}
{% if page_type == 'ranking' or page_type == 'final_ranking' %}
<script type="text/javascript">
$.fn.ignore = function(sel) {
return this.clone().find(sel || '>*').remove().end();