合并dev,添加管理员在前台可见比赛所有提交详情,修改措辞,修改提示形式,以便于提交列表筛选功能的使用
This commit is contained in:
@@ -18,17 +18,19 @@
|
||||
<tr class="" success>
|
||||
<th>#</th>
|
||||
<th>提交时间</th>
|
||||
<th>结果</th>
|
||||
<th>运行时间</th>
|
||||
<th>语言</th>
|
||||
<th>运行时间</th>
|
||||
<th>结果</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr class="{{ item.result|translate_result_class }}">
|
||||
<tr>
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/">{{ forloop.counter }}</a></th>
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>{{ item.result|translate_result }}</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
</td>
|
||||
<td>
|
||||
{% if item.accepted_answer_time %}
|
||||
{{ item.accepted_answer_time }}ms
|
||||
@@ -36,8 +38,8 @@
|
||||
--
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
<td class="alert-{{ item.result|translate_result_class }}">
|
||||
<strong>{{ item.result|translate_result }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
@@ -21,33 +21,67 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
{% if submissions %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
<th>#</th>
|
||||
<td>用户</td>
|
||||
<th>题目名称</th>
|
||||
<th>用户</th>
|
||||
<th>提交时间</th>
|
||||
<th>结果</th>
|
||||
<th>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" id="languageFilter" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="true">
|
||||
语言<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="languageFilter">
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?language=1">C</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?language=2">C++</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?language=3">Java</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/">取消筛选</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</th>
|
||||
<th>运行时间</th>
|
||||
<th>语言</th>
|
||||
<th>
|
||||
<div class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" id="resultFilter" data-toggle="dropdown"
|
||||
aria-haspopup="true" aria-expanded="true">
|
||||
结果<span class="caret"></span>
|
||||
</a>
|
||||
<ul class="dropdown-menu" aria-labelledby="resultFilter">
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=0">Accepted</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=6">Wrong Answer</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=1">Runtime Error</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=2">Time Limit Exceeded</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=3">Memory Limit Exceeded</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=4">Compile Error</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/?result=5">Format Error</a></li>
|
||||
<li><a href="/contest/{{ contest.id }}/submissions/">取消筛选</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% if submissions %}
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr class="{{ item.result|translate_result_class }}">
|
||||
|
||||
{% for item in submissions %}
|
||||
<tr>
|
||||
{% ifequal item.user_id request.user.id %}
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/">
|
||||
{{ forloop.counter |add:start_id }}</a></th>
|
||||
{% else %}
|
||||
<th scope="row">{{ forloop.counter |add:start_id }}</th>
|
||||
{% endifequal %}
|
||||
|
||||
<th scope="row">
|
||||
<a href="/contest/{{ item.contest_id }}/problem/{{ item.problem_id }}/">{{ item.title }}</a>
|
||||
</th>
|
||||
<td>{{ item.user_id|get_username }}</td>
|
||||
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>{{ item.result|translate_result }}</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
</td>
|
||||
<td>
|
||||
{% if item.accepted_answer_time %}
|
||||
{{ item.accepted_answer_time }}ms
|
||||
@@ -55,28 +89,28 @@
|
||||
--
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
<td class="alert-{{ item.result|translate_result_class }}">
|
||||
<strong>{{ item.result|translate_result }}</strong>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
</tbody>
|
||||
{% else %}
|
||||
<p>本场比赛还没有提交记录</p>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>你还没有提交记录!</p>
|
||||
{% endif %}
|
||||
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
{% if previous_page %}
|
||||
<li class="previous"><a
|
||||
href="/contest/{{ contest.id }}/submissions/{{ previous_page }}/">
|
||||
href="/contest/{{ contest.id }}/submissions/{{ previous_page }}/{% if filter %}?{{ filter.name }}={{ filter.content }}{% endif %}">
|
||||
<span aria-hidden="true">←</span> 上一页</a></li>
|
||||
{% endif %}
|
||||
{% if next_page %}
|
||||
<li class="next">
|
||||
<a href="/contest/{{ contest.id }}/submissions/{{ next_page }}/">下一页 <span
|
||||
aria-hidden="true">→</span></a></li>
|
||||
<a href="/contest/{{ contest.id }}/submissions/{{ next_page }}/{% if filter %}?{{ filter.name }}={{ filter.content }}{% endif %}">
|
||||
下一页 <span aria-hidden="true">→</span></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
|
||||
78
template/src/oj/contest/submissions_list_admin.html
Normal file
78
template/src/oj/contest/submissions_list_admin.html
Normal file
@@ -0,0 +1,78 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
{% load submission %}
|
||||
{% load user %}
|
||||
<div class="container main">
|
||||
<div class="contest-tab">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/">比赛详情</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/problems/">题目</a>
|
||||
</li>
|
||||
<li role="presentation" class="active">
|
||||
<a href="/contest/{{ contest.id }}/submissions/">提交</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/rank/">排名</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
<th>#</th>
|
||||
<td>用户</td>
|
||||
<th>提交时间</th>
|
||||
<th>结果</th>
|
||||
<th>运行时间</th>
|
||||
<th>语言</th>
|
||||
</tr>
|
||||
</thead>
|
||||
{% if submissions %}
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr class="{{ item.result|translate_result_class }}">
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
|
||||
{{ forloop.counter |add:start_id }}</a></th>
|
||||
<td>{{ item.user_id|get_username }}</td>
|
||||
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>{{ item.result|translate_result }}</td>
|
||||
<td>
|
||||
{% if item.accepted_answer_time %}
|
||||
{{ item.accepted_answer_time }}ms
|
||||
{% else %}
|
||||
--
|
||||
{% endif %}
|
||||
</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% else %}
|
||||
<p>本场比赛还没有提交记录!</p>
|
||||
{% endif %}
|
||||
</table>
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
{% if previous_page %}
|
||||
<li class="previous"><a
|
||||
href="/contest/{{ contest.id }}/submissions/{{ previous_page }}/">
|
||||
<span aria-hidden="true">←</span> 上一页</a></li>
|
||||
{% endif %}
|
||||
{% if next_page %}
|
||||
<li class="next">
|
||||
<a href="/contest/{{ contest.id }}/submissions/{{ next_page }}/">下一页 <span
|
||||
aria-hidden="true">→</span></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -4,8 +4,14 @@
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<a href="/problem/{{ problem.id }}/">题目</a></li>
|
||||
<li role="presentation"><a href="/problem/{{ problem.id }}/submissions/">我的提交</a></li>
|
||||
<a href="/problem/{{ problem.id }}/">题目</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/problem/{{ problem.id }}/submissions/">我的提交</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/problems/">返回</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% include "oj/problem/_problem_header.html" %}
|
||||
|
||||
@@ -23,7 +29,7 @@
|
||||
<div class="problem-section">
|
||||
<label class="problem-label">输出</label>
|
||||
|
||||
<p class="problem-detail">{{ problem.output_description }}k</p>
|
||||
<p class="problem-detail">{{ problem.output_description }}</p>
|
||||
</div>
|
||||
{% for item in samples %}
|
||||
<div class="problem-section">
|
||||
@@ -33,7 +39,6 @@
|
||||
|
||||
</div>
|
||||
<div class="problem-section">
|
||||
|
||||
<label class="problem-label">样例输出{{ forloop.counter }}</label>
|
||||
<pre>
|
||||
{{ item.output }}</pre>
|
||||
@@ -45,23 +50,19 @@
|
||||
{% if problem.hint %}
|
||||
<div class="problem-section hide">
|
||||
<label class="problem-label">提示</label>
|
||||
|
||||
<div class="problem-detail">{{ problem.hint|safe }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="problem-section hide">
|
||||
<label class="problem-label">标签</label>
|
||||
|
||||
<p class="problem-detail">
|
||||
{% for tag in problem.tags.all %}
|
||||
<span class="label label-success">{{ tag.name }}</span>
|
||||
{% endfor %}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label>选择语言</label>
|
||||
|
||||
<div>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="language" value="1" checked> C (gcc 4.8)
|
||||
@@ -74,7 +75,6 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="code-field">
|
||||
<label class="problem-label">提交代码</label>
|
||||
<textarea id="code-editor"></textarea>
|
||||
@@ -85,9 +85,7 @@
|
||||
提交代码
|
||||
</button>
|
||||
<img src="/static/img/loading.gif" id="loading-gif">
|
||||
|
||||
</div>
|
||||
|
||||
<div id="result">
|
||||
</div>
|
||||
<hr>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
|
||||
{% load submission %}
|
||||
<div class="container main">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
@@ -9,6 +8,7 @@
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>题目名称</th>
|
||||
<th>提交时间</th>
|
||||
<th>
|
||||
<div class="dropdown">
|
||||
@@ -48,8 +48,12 @@
|
||||
<tbody>
|
||||
{% for item in submissions %}
|
||||
<tr>
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
|
||||
{{ forloop.counter |add:start_id }}</a></th>
|
||||
<th scope="row">
|
||||
<a href="/submission/{{ item.id }}/">{{ forloop.counter |add:start_id }}</a>
|
||||
</th>
|
||||
<td>
|
||||
<a href="/problem/{{ item.problem_id }}/">{{ item.problem_id }}</a>
|
||||
</td>
|
||||
<td>{{ item.create_time }}</td>
|
||||
<td>
|
||||
{{ item.language|translate_language }}
|
||||
@@ -92,4 +96,4 @@
|
||||
{% include "oj/announcement/_announcement_panel.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -56,7 +56,7 @@
|
||||
{{ request.user.username }}
|
||||
<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/submission/">我的提交</a></li>
|
||||
<li><a href="/submissions/">我的提交</a></li>
|
||||
<li><a href="#">我的资料</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="/logout/">退出</a></li>
|
||||
@@ -97,4 +97,4 @@
|
||||
</div>
|
||||
<!-- footer end -->
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user