NDOJ/templates/submission/source.html

64 lines
2 KiB
HTML
Raw Normal View History

2020-01-21 06:35:58 +00:00
{% extends "submission/info-base.html" %}
{% block media %}
<style>
.line {
position: relative;
}
.highlighter {
position: absolute;
width: 9999px;
top: 0;
bottom: 0;
left: 0;
right: 0;
}
a:active .line .highlighter {
background: rgba(255, 212, 0, 0.48);
}
2021-11-08 02:06:03 +00:00
.copy-clipboard {
margin-top: 0;
}
2020-01-21 06:35:58 +00:00
</style>
{% endblock %}
{% block body %}
<br>
<div><a href="{{ url('submission_status', submission.id) }}">{{ _('View status') }}</a></div>
<div><a href="{{ url('submission_source_raw', submission.id) }}">{{ _('View raw source') }}</a></div>
{% if request.user == submission.user.user or perms.judge.resubmit_other %}
<div><a href="{{ url('problem_submit', submission.problem.code, submission.id) }}">{{ _('Resubmit') }}</a></div>
{% endif %}
{% if perms.judge.rejudge_submission %}
<div>
<form action="{{ url('submission_rejudge') }}" method="post">
{% csrf_token %}
<a href="#" onclick="parentNode.submit()">{{ _('Rejudge') }}</a>
<input type="hidden" name="id" value="{{ submission.id }}">
<input type="hidden" name="path" value="{{ url('submission_status', submission.id) }}">
</form>
</div>
{% endif %}
<br>
<hr>
2020-01-21 06:35:58 +00:00
<br>
<div class="source-wrap">
2021-11-08 02:06:03 +00:00
<table style="width: 100%">
2020-01-21 06:35:58 +00:00
<tr>
2021-11-08 02:06:03 +00:00
<td class="source-ln" style="width: 0">
2020-01-21 06:35:58 +00:00
<div>
{% for line in raw_source.split('\n') %}
<a href="#line-{{ loop.index }}" name="line-{{ loop.index }}">
<pre class="line">{{ loop.index }}</pre>
</a>
{% endfor %}
</div>
</td>
<td class="source-code">{{ highlighted_source }}</td>
</tr>
</table>
</div>
{% endblock %}