[合并]与dev合并并修复了冲突

This commit is contained in:
esp
2015-08-23 18:06:17 +08:00
143 changed files with 646 additions and 27028 deletions

View File

@@ -0,0 +1,12 @@
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
公告
</h3></div>
<div class="panel-body">
{% for item in announcements %}
<p>{{ forloop.counter }}.&nbsp;&nbsp;<a href="/announcement/{{ item.id }}/" target="_blank">{{ item.title }}</a></p>
{% endfor %}
</div>
</div>

View 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>

View 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 %}

View File

@@ -0,0 +1,81 @@
{% extends "oj_base.html" %}
{% block body %}
{% load contest %}
<div class="container main">
<div class="row">
<div class="col-lg-9">
<div class="row">
<div class="right">
<form class="form-inline" method="get">
<div class="form-group-sm">
<input name="keyword" class="form-control" placeholder="请输入关键词">
<input type="submit" value="搜索" class="btn btn-primary">
</div>
</form>
</div>
</div>
<div>
<table class="table table-striped">
<thead>
<tr>
<th>#</th>
<th>比赛名称</th>
<th>开始时间</th>
<th>比赛类型</th>
<th>状态</th>
</tr>
</thead>
<tbody>
{% for item in contests %}
<tr>
<th scope="row"><a href="/contest/{{ item.id }}/">{{ item.id }}</a></th>
<td><a href="/contest/{{ item.id }}/">{{ item.title }}</a></td>
<td>{{ item.start_time }}</td>
{% ifequal item.contest_type 0 %}
<td>小组赛</td>
{% endifequal %}
{% ifequal item.contest_type 1 %}
<td>公开赛</td>
{% endifequal %}
{% ifequal item.contest_type 2 %}
<td>公开赛(密码保护)</td>
{% endifequal %}
<td class="{{ item|contest_status_color }}">{{ item|contest_status }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<div class="form-group">
<label>仅显示当前可参加的比赛
<input id="join" type="checkbox" {% if join %}checked{% endif %} onchange="if(this.checked){location.href='/contests/?join=True'}else{location.href='/contests/'}">
</label>
</div>
<nav>
<ul class="pager">
{% if previous_page %}
<li class="previous">
<a href="/contests/{{ previous_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if join %}?join={{ join }}{% endif %}">
<span aria-hidden="true">&larr;</span> 上一页</a></li>
{% endif %}
{% if next_page %}
<li class="next">
<a href="/contests/{{ next_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if join %}?join={{ join }}{% endif %}">下一页 <span
aria-hidden="true">&rarr;</span></a></li>
{% endif %}
</ul>
</nav>
</div>
</div>
<div class="col-lg-3">
{% include "oj/announcement/_announcement_panel.html" %}
</div>
</div>
</div>
{% endblock %}
{% block js_block %}
{% endblock %}

View File

@@ -0,0 +1,41 @@
{% 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>
{% if show_tab %}
<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>
{% endif %}
</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>
{% endifequal %}
{% ifequal reason "group_limited" %}
<div class="alert alert-danger" role="alert">比赛仅指定小组可以参加,你不在这些小组中。</div>
{% endifequal %}
{% ifequal reason "contest_not_start" %}
<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 %}

View File

@@ -55,18 +55,7 @@
</div>
<div class="col-lg-3">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">
<span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
公告
</h3></div>
<div class="panel-body">
{% for item in announcements %}
{{ forloop.counter }}.&nbsp;&nbsp;<a href="/announcement/{{ item.id }}/" target="_blank">{{ item.title }}</a>
{% endfor %}
</div>
</div>
{% include "oj/announcement/_announcement_panel.html" %}
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">

View File

@@ -2,65 +2,57 @@
{% block body %}
{% load submission %}
<div class="container main">
<ul class="nav nav-tabs nav-tabs-google">
<li role="presentation">
<a href="/submission/">提交</a></li>
<li role="presentation" class="active">
<a href="/submission/my_submissions/">我的提交</a></li>
</ul>
{% load submission %}
<div class="container main">
{% if submissions %}
<table class="table table-bordered">
<thead>
<tr class="" success>
<th>#</th>
<th>提交时间</th>
<th>结果</th>
<th>运行时间</th>
<th>语言</th>
</tr>
</thead>
<tbody>
{% for item in submissions %}
<tr class="{{ item.result|translate_result_class }}">
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
{{ forloop.counter |add:start_id }}</a></th>
<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 %}
<br>
{% if submissions %}
<table class="table table-bordered">
<thead>
<tr class="" success>
<th>#</th>
<th>提交时间</th>
<th>结果</th>
<th>运行时间</th>
<th>语言</th>
</tr>
</thead>
<tbody>
{% for item in submissions %}
<tr class="{{ item.result|translate_result_class }}">
<th scope="row"><a href="/my_submission/{{ item.id }}/" id="id_{{ forloop.counter }}">
{{ forloop.counter |add:startId }}</a></th>
<td>{{ item.create_time }}</td>
<td>{{ item.result|translate_result }}</td>
<td>
{% if item.accepted_answer_time %}
{{ item.accepted_answer_time }}ms
{% else %}
--
</tbody>
</table>
{% else %}
<p>你还没有提交记录!</p>
{% endif %}
<nav>
<ul class="pager">
{% if previous_page %}
<li class="previous"><a
href="/my_submissions/{{ previous_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">
<span aria-hidden="true">&larr;</span> 上一页</a></li>
{% endif %}
</td>
<td>
{{ item.language|translate_language }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>你还没有提交记录!</p>
{% endif %}
<nav>
<ul class="pager">
{% if previous_page %}
<li class="previous"><a
href="/my_submissions/{{ previous_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">
<span aria-hidden="true">&larr;</span> 上一页</a></li>
{% endif %}
{% if next_page %}
<li class="next"><a
href="/my_submissions/{{ next_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">下一页 <span
aria-hidden="true">&rarr;</span></a></li>
{% endif %}
</ul>
</nav>
</div>
{% if next_page %}
<li class="next"><a
href="/my_submissions/{{ next_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">下一页 <span
aria-hidden="true">&rarr;</span></a></li>
{% endif %}
</ul>
</nav>
</div>
{% endblock %}

View File

@@ -43,7 +43,7 @@
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/problems/">题目</a></li>
<li><a href="/submissions/">提交</a></li>
<li><a href="/my_submissions/">提交</a></li>
<li><a href="/contests/">比赛</a></li>
<li><a href="/about/">关于</a></li>
</ul>