Add icons to status page

This commit is contained in:
cuom1999 2022-08-22 23:30:41 -05:00
parent f25c389b7f
commit 83192b540e
3 changed files with 40 additions and 4 deletions

View file

@ -295,7 +295,7 @@
<input type="file" id="file-upload">
<div class="submit-bar">
{{ form.judge }}
<input type="submit" value="{{ _('Submit!') }}" class="button"
<input type="submit" value="{{ _('Submit!') }}" class="button small"
{% if request.in_contest and submission_limit and not submissions_left %}disabled{% endif %}>
</div>
{% endif %}

View file

@ -24,13 +24,29 @@
{% else %}
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Execution Results') }}</h3>
{% endif %}
{% for batch in batches %}
<div style="margin-top: 0.5em;">
{% if batch.id %}
<b>{{ _('Batch ') }}#{{ loop.index }}: </b>
{% endif %}
{% for case in batch.cases %}
<span class="case-{{ case.status }} case-icons">
{% if case.status == 'AC' %}
<i id="icon-{{case.id}}" class="icofont-check-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
{% elif case.status != 'SC' %}
<i id="icon-{{case.id}}" class="icofont-close-circled" title="{{ _('Case') }} #{{ loop.index }} - {{ case.status }}"></i>
{% endif %}
</span>
{% endfor %}
</div>
{% endfor %}
<br>
<table class="testcases-table">
{% if submission.is_graded and submission.result != 'AB' %}
<thead>
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
<td><span class="col-title">{{_('Overall: ')}}</span>
{% if request.in_contest_mode and submission.contest_or_none %}
{% with contest=submission.contest_or_none %}

View file

@ -35,6 +35,12 @@
font-size: 1.54em;
margin-bottom: 1em;
}
.case-icons i {
font-size: large;
font-weight: bolder;
cursor: pointer;
}
</style>
{% endblock %}
{% block content_js_media %}
@ -55,9 +61,24 @@
url: '{{ url('submission_testcases_query') }}',
data: {id: '{{ submission.id }}'}
}).done(function (data) {
data = $(data);
list.find(".open").each(function() {
var id = $(this).attr("id");
data.find("#" + id).removeClass("closed").addClass("open");
data.find("#" + id + "-output").show();
});
list.empty().html(data).find('.toggle').each(function () {
register_toggle($(this));
});
$(".case-icons i").each(function() {
$(this).on("click", function() {
var id = "tr#" + $(this).attr("id").split("-")[1];
$(id).click();
$([document.documentElement, document.body]).animate({
scrollTop: $(id).offset().top - 50
}, 800);
});
});
setTimeout(function () {
blocked = false;
if (request)
@ -70,7 +91,6 @@
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100)
$("html, body").animate({scrollTop: $(document).height()}, 0);
}
register_toggle($('#source-header'));
var receiver = new EventReceiver(
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",