Add icons to status page
This commit is contained in:
parent
f25c389b7f
commit
83192b540e
3 changed files with 40 additions and 4 deletions
|
@ -295,7 +295,7 @@
|
||||||
<input type="file" id="file-upload">
|
<input type="file" id="file-upload">
|
||||||
<div class="submit-bar">
|
<div class="submit-bar">
|
||||||
{{ form.judge }}
|
{{ 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 %}>
|
{% if request.in_contest and submission_limit and not submissions_left %}disabled{% endif %}>
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -24,13 +24,29 @@
|
||||||
{% else %}
|
{% else %}
|
||||||
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Execution Results') }}</h3>
|
<h3><i class="fa fa-check-square-o fa-fw"></i>{{ _('Execution Results') }}</h3>
|
||||||
{% endif %}
|
{% 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>
|
<br>
|
||||||
|
|
||||||
<table class="testcases-table">
|
<table class="testcases-table">
|
||||||
{% if submission.is_graded and submission.result != 'AB' %}
|
{% if submission.is_graded and submission.result != 'AB' %}
|
||||||
<thead>
|
<thead>
|
||||||
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
<tr id="overall-row" class="case-row overall-result-{{submission.result}}">
|
||||||
|
|
||||||
<td><span class="col-title">{{_('Overall: ')}}</span>
|
<td><span class="col-title">{{_('Overall: ')}}</span>
|
||||||
{% if request.in_contest_mode and submission.contest_or_none %}
|
{% if request.in_contest_mode and submission.contest_or_none %}
|
||||||
{% with contest=submission.contest_or_none %}
|
{% with contest=submission.contest_or_none %}
|
||||||
|
|
|
@ -35,6 +35,12 @@
|
||||||
font-size: 1.54em;
|
font-size: 1.54em;
|
||||||
margin-bottom: 1em;
|
margin-bottom: 1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.case-icons i {
|
||||||
|
font-size: large;
|
||||||
|
font-weight: bolder;
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% block content_js_media %}
|
{% block content_js_media %}
|
||||||
|
@ -55,9 +61,24 @@
|
||||||
url: '{{ url('submission_testcases_query') }}',
|
url: '{{ url('submission_testcases_query') }}',
|
||||||
data: {id: '{{ submission.id }}'}
|
data: {id: '{{ submission.id }}'}
|
||||||
}).done(function (data) {
|
}).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 () {
|
list.empty().html(data).find('.toggle').each(function () {
|
||||||
register_toggle($(this));
|
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 () {
|
setTimeout(function () {
|
||||||
blocked = false;
|
blocked = false;
|
||||||
if (request)
|
if (request)
|
||||||
|
@ -70,7 +91,6 @@
|
||||||
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100)
|
if ($(window).scrollTop() + $(window).height() > $(document).height() - 100)
|
||||||
$("html, body").animate({scrollTop: $(document).height()}, 0);
|
$("html, body").animate({scrollTop: $(document).height()}, 0);
|
||||||
}
|
}
|
||||||
register_toggle($('#source-header'));
|
|
||||||
|
|
||||||
var receiver = new EventReceiver(
|
var receiver = new EventReceiver(
|
||||||
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
"{{ EVENT_DAEMON_LOCATION }}", "{{ EVENT_DAEMON_POLL_LOCATION }}",
|
||||||
|
|
Loading…
Add table
Reference in a new issue