Add option to only show total score in contest
This commit is contained in:
parent
26c277c612
commit
eadd4f2ad3
25 changed files with 7849 additions and 5710 deletions
|
@ -48,7 +48,7 @@ class DefaultContestFormat(BaseContestFormat):
|
|||
format_data = (participation.format_data or {}).get(str(contest_problem.id))
|
||||
if format_data:
|
||||
return format_html(
|
||||
u'<td class="{state}"><a href="{url}">{points}<div class="solving-time">{time}</div></a></td>',
|
||||
u'<td class="{state} problem-score-col"><a href="{url}">{points}<div class="solving-time">{time}</div></a></td>',
|
||||
state=(('pretest-' if self.contest.run_pretests_only and contest_problem.is_pretested else '') +
|
||||
self.best_solution_state(format_data['points'], contest_problem.points)),
|
||||
url=reverse('contest_user_submissions',
|
||||
|
@ -57,7 +57,7 @@ class DefaultContestFormat(BaseContestFormat):
|
|||
time=nice_repr(timedelta(seconds=format_data['time']), 'noday'),
|
||||
)
|
||||
else:
|
||||
return mark_safe('<td></td>')
|
||||
return mark_safe('<td class="problem-score-col"></td>')
|
||||
|
||||
def display_participation_result(self, participation):
|
||||
return format_html(
|
||||
|
|
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -55,7 +55,7 @@
|
|||
|
||||
{% block before_point_head %}
|
||||
{% for problem in problems %}
|
||||
<th class="points header"><a href="{{ url('contest_ranked_submissions', contest.key, problem.problem.code) }}">
|
||||
<th class="points header problem-score-col"><a href="{{ url('contest_ranked_submissions', contest.key, problem.problem.code) }}">
|
||||
{{- loop.index }}
|
||||
<div class="point-denominator">{{ problem.points }}</div>
|
||||
</a></th>
|
||||
|
|
|
@ -329,6 +329,16 @@
|
|||
})
|
||||
{% endif %}
|
||||
|
||||
$('#show-total-score-checkbox').click(function() {
|
||||
let checked = $('#show-total-score-checkbox').is(':checked');
|
||||
if (checked) {
|
||||
$('.problem-score-col').hide();
|
||||
}
|
||||
else {
|
||||
$('.problem-score-col').show();
|
||||
}
|
||||
})
|
||||
|
||||
highlightFirstSolve();
|
||||
|
||||
});
|
||||
|
@ -348,11 +358,13 @@
|
|||
|
||||
<input id="show-fullnames-checkbox" type="checkbox" style="vertical-align: bottom">
|
||||
|
||||
<label for="show-fullnames-checkbox" style="vertical-align: bottom; margin-right: 1em;">Hiển thị tên thật</label>
|
||||
<label for="show-fullnames-checkbox" style="vertical-align: bottom; margin-right: 1em;">{{ _('Show full name') }}</label>
|
||||
{% if request.user.is_authenticated %}
|
||||
<input id="show-friends-checkbox" type="checkbox" style="vertical-align: bottom;">
|
||||
<label for="show-friends-checkbox" style="vertical-align: bottom;">{{ _('Show friends only') }}</label>
|
||||
<label for="show-friends-checkbox" style="vertical-align: bottom; margin-right: 1em;">{{ _('Show friends only') }}</label>
|
||||
{% endif %}
|
||||
<input id="show-total-score-checkbox" type="checkbox" style="vertical-align: bottom;">
|
||||
<label for="show-total-score-checkbox" style="vertical-align: bottom;">{{ _('Total score only') }}</label>
|
||||
</div>
|
||||
{% include "contest/ranking-table.html" %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Reference in a new issue