创建了单个比赛的详情页
This commit is contained in:
38
template/oj/contest/_contest_header.html
Normal file
38
template/oj/contest/_contest_header.html
Normal file
@@ -0,0 +1,38 @@
|
||||
{% load contest %}
|
||||
<h2 class="text-center">{{ contest.title }}</h2>
|
||||
|
||||
<hr>
|
||||
<div>
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>开始时间</th>
|
||||
<th>结束时间</th>
|
||||
<th>状态</th>
|
||||
<th>比赛类型</th>
|
||||
<th>创建者</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>{{ contest.start_time }}</td>
|
||||
<td>{{ contest.end_time }}</td>
|
||||
<td>{{ contest|contest_status }}</td>
|
||||
{% ifequal contest.contest_type 0 %}
|
||||
<td>小组赛</td>
|
||||
{% endifequal %}
|
||||
{% ifequal contest.contest_type 1 %}
|
||||
<td>公开赛</td>
|
||||
{% endifequal %}
|
||||
{% ifequal contest.contest_type 2 %}
|
||||
<td>公开赛(密码保护)</td>
|
||||
{% endifequal %}
|
||||
|
||||
<td>{{ contest.created_by.username }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<hr>
|
||||
<div>{{ contest.description|safe }}</div>
|
||||
</div>
|
||||
<p class="text-center"></p>
|
||||
21
template/oj/contest/contest_index.html
Normal file
21
template/oj/contest/contest_index.html
Normal file
@@ -0,0 +1,21 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<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">
|
||||
<a href="/contest/{{ contest.id }}/rank/">排名</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% include "oj/contest/_contest_header.html" %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
26
template/oj/contest/contest_no_privilege.html
Normal file
26
template/oj/contest/contest_no_privilege.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="container main">
|
||||
<ul class="nav nav-tabs nav-tabs-google">
|
||||
<li role="presentation" class="active">
|
||||
<a href="/contest/{{ contest.id }}/">比赛详情</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% include "oj/contest/_contest_header.html" %}
|
||||
{% ifequal reason "password_protect" %}
|
||||
<div class="form-inline">
|
||||
<div class="form-group">
|
||||
<label>密码</label>
|
||||
<input type="password" class="form-control" id="contest-password" placeholder="请输入密码">
|
||||
</div>
|
||||
<button type="button" id="contest-password-btn" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="alert alert-danger" role="alert">比赛仅指定小组可以参加,你不在这些小组中。</div>
|
||||
{% endifequal %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/contest/contest_password.js"></script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user