Merge branch 'dev-sxw' of https://git.coding.net/virusdefender/qduoj
Conflicts: contest/views.py template/src/oj/contest/contest_rank.html template/src/oj/contest/submissions_list.html
This commit is contained in:
@@ -127,9 +127,7 @@
|
||||
|
||||
<script src="/static/js/config.js"></script>
|
||||
<script src="/static/js/require.js"></script>
|
||||
<script>
|
||||
require(["bootstrap", "admin"]);
|
||||
</script>
|
||||
<script src="/static/js/app/admin/admin.js"></script>
|
||||
|
||||
<!-- footer begin -->
|
||||
<div class="footer">
|
||||
|
||||
@@ -34,5 +34,5 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/account/change_password.js"></script>
|
||||
<script src="/static/js/app/oj/account/changePassword.js"></script>
|
||||
{% endblock %}
|
||||
@@ -78,5 +78,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/problem/problem_list.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -2,68 +2,73 @@
|
||||
{% block body %}
|
||||
{% load submission %}
|
||||
<div class="container main">
|
||||
<div class="col-lg-12 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">
|
||||
<a href="/contest/{{ contest.id }}/submissions/">提交</a>
|
||||
</li>
|
||||
<li role="presentation" class="active">
|
||||
<a href="/contest/{{ contest.id }}/rank/">排名</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<ul class="nav nav-tabs nav-tabs-google contest-tab">
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/">比赛详情</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/problems/">题目</a>
|
||||
</li>
|
||||
<li role="presentation">
|
||||
<a href="/contest/{{ contest.id }}/submissions/">提交</a>
|
||||
</li>
|
||||
<li role="presentation" class="active">
|
||||
<a href="/contest/{{ contest.id }}/rank/">排名</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<h2 class="text-center">排名(
|
||||
{% if real_time_rank %}
|
||||
实时
|
||||
实时
|
||||
{% else %}
|
||||
已封榜
|
||||
{% endif %})
|
||||
</h2>
|
||||
{% if result %}
|
||||
<table class="table table-bordered text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th class="text-center">用户名</th>
|
||||
<th class="text-center">AC / 总提交</th>
|
||||
<th class="text-center">用时 + 罚时</th>
|
||||
{% for item in contest_problems %}
|
||||
<th class="text-center"><a href="/contest/{{ contest.id }}/problem/{{ item.id }}/">{{ item.sort_index }}</a>
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="rank">
|
||||
{% for item in result %}
|
||||
已封榜
|
||||
{% endif %})
|
||||
</h2>
|
||||
{% if result %}
|
||||
<table class="table table-bordered text-center">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="row">{{ forloop.counter }}</th>
|
||||
<td>{{ item.username }}</td>
|
||||
<td>{{ item.total_ac }} / {{ item.total_submit }}</td>
|
||||
<td>{% if item.total_time %}{{ item.total_time }}{% else %}--{% endif %}</td>
|
||||
{% for problem in item.problems %}
|
||||
<td class="{% if problem %}{% if problem.ac %}{% if problem.first_achieved %}first-achieved{% else %}alert-success{% endif %}{% else %}alert-danger{% endif %}{% endif %}">
|
||||
{% if problem.ac %}{{ problem.ac_time }}{% endif %}
|
||||
{% if problem.failed_number %}
|
||||
(-{{ problem.failed_number }})
|
||||
{% endif %}
|
||||
</td>
|
||||
<th>#</th>
|
||||
<th class="text-center">用户名</th>
|
||||
<th class="text-center">AC / 总提交</th>
|
||||
<th class="text-center">用时 + 罚时</th>
|
||||
{% for item in contest_problems %}
|
||||
<th class="text-center"><a
|
||||
href="/contest/{{ contest.id }}/problem/{{ item.id }}/">{{ item.sort_index }}</a>
|
||||
</th>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %} onchange="if(this.checked){location.href='?auto_refresh=true'}else{location.href=location.href.split('?')[0]}"> 自动刷新
|
||||
</thead>
|
||||
<tbody class="rank">
|
||||
{% for item in result %}
|
||||
<tr>
|
||||
<th scope="row">{{ forloop.counter }}</th>
|
||||
<td>{{ item.username }}</td>
|
||||
<td>{{ item.total_ac }} / {{ item.total_submit }}</td>
|
||||
<td>{% if item.total_time %}{{ item.total_time }}{% else %}--{% endif %}</td>
|
||||
{% for problem in item.problems %}
|
||||
<td class="
|
||||
{% if problem %}{% if problem.ac %}{% if problem.first_achieved %}first-achieved{% else %}alert-success{% endif %}{% else %}alert-danger{% endif %}{% endif %}">
|
||||
{% if problem.ac %}{{ problem.ac_time }}{% endif %}
|
||||
{% if problem.failed_number %}
|
||||
(-{{ problem.failed_number }})
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endfor %}
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
<input type="checkbox" id="auto-refresh" {% if auto_refresh %}checked{% endif %}
|
||||
onchange="if(this.checked){location.href='?auto_refresh=true'}else{location.href=location.href.split('?')[0]}">
|
||||
自动刷新
|
||||
{% else %}
|
||||
<p>还没有结果</p>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -71,11 +76,11 @@
|
||||
|
||||
|
||||
{% block js_block %}
|
||||
{% if auto_refresh %}
|
||||
<script>
|
||||
setTimeout(function(){
|
||||
location.reload();
|
||||
}, 5000);
|
||||
</script>
|
||||
{% if auto_refresh %}
|
||||
<script>
|
||||
setTimeout(function () {
|
||||
location.reload();
|
||||
}, 5000);
|
||||
</script>
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
@@ -37,5 +37,5 @@
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/contest/contest_password.js"></script>
|
||||
<script src="/static/js/app/oj/contest/contestPassword.js"></script>
|
||||
{% endblock %}
|
||||
@@ -21,59 +21,59 @@
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
<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>
|
||||
<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 %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
<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>
|
||||
<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>
|
||||
|
||||
{% if item.user_id == request.user.id and request.user.admin_type == 2%}
|
||||
<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">
|
||||
{% if item.show_link %}
|
||||
<a href="/submission/{{ item.id }}/">{{ forloop.counter |add:start_id }}</a>
|
||||
{% else %}
|
||||
{{ forloop.counter |add:start_id }}
|
||||
{% endif %}
|
||||
</th>
|
||||
<th scope="row">
|
||||
<a href="/contest/{{ item.contest_id }}/problem/{{ item.problem_id }}/">{{ item.title }}</a>
|
||||
</th>
|
||||
@@ -95,10 +95,10 @@
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% else %}
|
||||
<p>本场比赛还没有提交记录</p>
|
||||
{% endif %}
|
||||
</table>
|
||||
{% else %}
|
||||
<p>本场比赛还没有提交记录</p>
|
||||
{% endif %}
|
||||
</table>
|
||||
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
|
||||
@@ -1,114 +0,0 @@
|
||||
{% 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>
|
||||
<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>
|
||||
<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>
|
||||
<th scope="row"><a href="/submission/{{ item.id }}/">
|
||||
{{ forloop.counter |add:start_id }}</a></th>
|
||||
<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.language|translate_language }}
|
||||
</td>
|
||||
<td>
|
||||
{% if item.accepted_answer_time %}
|
||||
{{ item.accepted_answer_time }}ms
|
||||
{% else %}
|
||||
--
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="alert-{{ item.result|translate_result_class }}">
|
||||
<strong>{{ item.result|translate_result }}</strong>
|
||||
</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 }}/{% 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 }}/{% if filter %}?{{ filter.name }}={{ filter.content }}{% endif %}">
|
||||
下一页 <span aria-hidden="true">→</span></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -5,7 +5,7 @@
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<title>青岛大学在线评测平台 - 首页</title>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="/static/css/fullpage/jquery.fullPage.css">
|
||||
<link href="/static/css/fullpage/jquery.fullPage.css" rel="stylesheet">
|
||||
<link rel="shortcut icon" href="/static/img/favicon.ico">
|
||||
<style>
|
||||
html, textarea, input, option, select, button {
|
||||
@@ -29,6 +29,36 @@
|
||||
padding: 20px 20px 0 20px;
|
||||
}
|
||||
|
||||
#login {
|
||||
float: right;
|
||||
position: relative;
|
||||
height: 30px;
|
||||
line-height: 64px;
|
||||
margin-right: 30px;
|
||||
z-index: 10;
|
||||
margin-top: 4px;
|
||||
}
|
||||
|
||||
.login-zone .button:first-child {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.button {
|
||||
display: inline-block;
|
||||
padding: 0 2em;
|
||||
text-transform: none;
|
||||
line-height: 2em;
|
||||
height: 2em;
|
||||
border-radius: 2em;
|
||||
border: 1px solid #FFF;
|
||||
outline: 0;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.button:first-child {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
#name {
|
||||
font-size: 45px;
|
||||
margin-right: 20px;
|
||||
@@ -86,8 +116,6 @@
|
||||
loopBottom: true
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</head>
|
||||
@@ -100,6 +128,12 @@
|
||||
<a href="/groups/">小组</a>
|
||||
<a href="/about/">关于</a>
|
||||
|
||||
{% if not request.user.is_authenticated %}
|
||||
<div id="login">
|
||||
<a href="/login/" class="login button">登录</a>
|
||||
<a href="/register/" class="register button">注册</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -62,7 +62,6 @@
|
||||
<div id="code-field">
|
||||
<textarea id="code-editor">{{ submission.code }}</textarea>
|
||||
</div>
|
||||
{% ifequal request.user.id submission.user_id %}
|
||||
|
||||
<div id="share-code" class="col-lg-6 col-md-6">
|
||||
{% if submission.shared %}
|
||||
@@ -74,7 +73,7 @@
|
||||
{% if not submission.shared %}style="display: none" {% endif %}>{{ problem.title }}
|
||||
{{ request.build_absolute_uri }}</textarea>
|
||||
</div>
|
||||
{% endifequal %}
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -89,5 +89,5 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/problem/problem_list.js"></script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -86,10 +86,6 @@
|
||||
<script src="/static/js/require.js"></script>
|
||||
<script>
|
||||
require(["bootstrap"]);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% block js_block %}{% endblock %}
|
||||
<!-- footer begin -->
|
||||
|
||||
@@ -20,8 +20,7 @@
|
||||
</p>
|
||||
|
||||
<p>
|
||||
青岛大学 ACM 队是一支优秀的队伍,一支充满活力与激情的队伍,它满载着光辉与荣誉。在过去的几年里,集训队的队员曾代表我校多次
|
||||
参加竞赛,获得了佳绩。
|
||||
青岛大学 ACM 队是一支优秀的队伍,一支充满活力与激情的队伍,它满载着光辉与荣誉。在过去的几年里,集训队的队员曾代表我校多次参加竞赛,获得了佳绩。
|
||||
</p>
|
||||
|
||||
<p>
|
||||
|
||||
Reference in New Issue
Block a user