NDOJ/templates/contest/moss.html
2020-01-21 15:35:58 +09:00

87 lines
3 KiB
HTML

{% extends "common-content.html" %}
{% block title_ruler %}{% endblock %}
{% block title_row %}
{% set tab = 'moss' %}
{% set title = contest.name %}
{% include "contest/contest-tabs.html" %}
{% endblock %}
{% block content_media %}
<style>
.panes {
display: flex;
flex-wrap: wrap;
justify-content: center;
}
.pane {
padding: 20px;
}
</style>
{% endblock %}
{% block content_js_media %}
<script type="text/javascript">
$(function () {
$('.contest-moss').click(function () {
return confirm('{{ _('Are you sure you want MOSS the contest?') }}');
});
});
$(function () {
$('.contest-moss-delete').click(function () {
return confirm('{{ _('Are you sure you want to delete the MOSS results?') }}');
});
});
</script>
{% endblock %}
{% block body %}
{% if has_results %}
<table class="table">
<thead>
<tr>
<th class="header">{{ _('Problem') }}</th>
{% for lang in languages %}
<th class="header">{{ lang }}</th>
{% endfor %}
</tr>
</thead>
<tbody>
{% for problem, results in moss_results %}
<tr id="problem-{{ problem.code }}">
<td>
<a href="{{ url('problem_detail', problem.code) }}">{{ problem.name }}</a>
</td>
{% for result in results %}
<td>
{% if result.submission_count %}
<a href="{{ result.url }}">{{ result.submission_count }} {{_('submissions')}}</a>
{% else %}
{{ _('No submissions') }}
{% endif %}
</td>
{% endfor %}
</tr>
{% endfor %}
</tbody>
</table>
{% endif %}
<div class="panes">
<div class="pane">
<form method="post" action="{{ url('contest_moss', contest.key) }}">
{% csrf_token %}
<input type="submit" class="unselectable button full contest-moss" style="padding: 10px;"
value="{% if has_results %} {{ _('Re-MOSS contest') }} {% else %} {{ _('MOSS contest') }} {% endif %}">
</form>
</div>
{% if has_results %}
<div class="pane">
<form method="post" action="{{ url('contest_moss_delete', contest.key) }}">
{% csrf_token %}
<input type="submit" class="unselectable button full contest-moss-delete" style="padding: 10px;"
value="{{ _('Delete MOSS results') }}">
</form>
</div>
{% endif %}
</div>
{% endblock %}