Merge branch 'dev' into hohoTT-dev
Conflicts: submission/tests.py template/src/oj/submission/my_submissions_list.html
This commit is contained in:
@@ -1,27 +1,33 @@
|
||||
{% extends "oj_base.html" %}
|
||||
{% block body %}
|
||||
<div class="container main">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h2 class="text-center">用户登录</h2>
|
||||
<div class="container main">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<h2 class="text-center">用户登录</h2>
|
||||
|
||||
<form id="login-form">
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" class="form-control input-lg" id="username" name="username" maxlength="30" data-error="请填写用户名" placeholder="用户名" autofocus required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" class="form-control input-lg" id="password" name="password" maxlength="30" data-error="请填写密码" placeholder="密码" required>
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<form id="login-form">
|
||||
<div class="form-group">
|
||||
<label for="username">用户名</label>
|
||||
<input type="text" class="form-control input-lg" id="username" name="username" maxlength="30"
|
||||
data-error="请填写用户名" placeholder="用户名" autofocus required>
|
||||
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">密码</label>
|
||||
<input type="password" class="form-control input-lg" id="password" name="password" maxlength="30"
|
||||
data-error="请填写密码" placeholder="密码" required>
|
||||
|
||||
<div class="help-block with-errors"></div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<button type="submit" class="btn btn-primary">提交</button>
|
||||
</div>
|
||||
<a href="/register/">还没有帐号?点击注册</a>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
{% block js_block %}
|
||||
<script src="/static/js/app/oj/account/login.js"></script>
|
||||
<script src="/static/js/app/oj/account/login.js"></script>
|
||||
{% endblock %}
|
||||
@@ -5,8 +5,13 @@
|
||||
公告
|
||||
</h3></div>
|
||||
<div class="panel-body">
|
||||
{% for item in announcements %}
|
||||
<p>{{ forloop.counter }}. <a href="/announcement/{{ item.id }}/" target="_blank">{{ item.title }}</a></p>
|
||||
{% endfor %}
|
||||
{% if announcements %}
|
||||
{% for item in announcements %}
|
||||
<p>{{ forloop.counter }}. <a href="/announcement/{{ item.id }}/" target="_blank">{{ item.title }}</a>
|
||||
</p>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<p>暂无可显示的公告</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,7 +3,7 @@
|
||||
{% load contest %}
|
||||
<div class="container main">
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<div class="row">
|
||||
<div class="right">
|
||||
<form class="form-inline" method="get">
|
||||
@@ -15,6 +15,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
{% if contests %}
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -47,6 +48,7 @@
|
||||
{% 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/'}">
|
||||
@@ -66,10 +68,13 @@
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% else %}
|
||||
<p>当前没有合适的比赛</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<div class="col-md-3 col-lg-3">
|
||||
{% include "oj/announcement/_announcement_panel.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-9">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<div>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
@@ -55,7 +55,7 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3">
|
||||
<div class="col-md-3 col-lg-3">
|
||||
{% include "oj/announcement/_announcement_panel.html" %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{% if result %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -49,6 +50,9 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>还没有结果</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<a href="/problem/{{ problem.id }}/submissions/">我的提交</a></li>
|
||||
</ul>
|
||||
{% include "oj/problem/_problem_header.html" %}
|
||||
{% if submissions %}
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr class="" success>
|
||||
@@ -42,5 +43,8 @@
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>你还没有提交该题目</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endblock %}
|
||||
@@ -3,7 +3,7 @@
|
||||
{% load problem %}
|
||||
<div class="container main">
|
||||
<div class="row">
|
||||
<div class="col-lg-9">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<div class="row">
|
||||
<div class="right">
|
||||
<form class="form-inline" method="get">
|
||||
@@ -54,7 +54,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3">
|
||||
<div class="col-md-3 col-lg-3">
|
||||
{% include "oj/announcement/_announcement_panel.html" %}
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">
|
||||
|
||||
@@ -1,58 +1,85 @@
|
||||
{% extends 'oj_base.html' %}
|
||||
|
||||
{% block body %}
|
||||
{% load submission %}
|
||||
<div class="container main">
|
||||
<div class="col-md-9 col-lg-9">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<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="/submissions/?result=0">Accepted</a></li>
|
||||
<li><a href="/submissions/?result=6">Wrong Answer</a></li>
|
||||
<li><a href="/submissions/?result=1">Runtime Error</a></li>
|
||||
<li><a href="/submissions/?result=2">Time Limit Exceeded</a></li>
|
||||
<li><a href="/submissions/?result=3">Memory Limit Exceeded</a></li>
|
||||
<li><a href="/submissions/?result=4">Compile Error</a></li>
|
||||
<li><a href="/submissions/?result=5">Format Error</a></li>
|
||||
<li><a href="/submissions/">取消筛选</a></li>
|
||||
</ul></div>
|
||||
</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="/submissions/?language=1">C</a></li>
|
||||
<li><a href="/submissions/?language=2">C++</a></li>
|
||||
<li><a href="/submissions/?language=3">Java</a></li>
|
||||
<li><a href="/submissions/">取消筛选</a></li>
|
||||
</ul></div>
|
||||
</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 %}
|
||||
|
||||
{% 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="/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 %}
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
{% else %}
|
||||
<p>你还没有提交记录!</p>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
<nav>
|
||||
<ul class="pager">
|
||||
{% if previous_page %}
|
||||
<li class="previous"><a
|
||||
href="/submissions/{{ previous_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">
|
||||
<span aria-hidden="true">←</span> 上一页</a></li>
|
||||
<li class="previous"><a
|
||||
href="/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="/submissions/{{ next_page }}/{% if keyword %}?keyword={{ keyword }}{% endif %}{% if tag %}?tag={{ tag }}{% endif %}">下一页 <span
|
||||
aria-hidden="true">→</span></a></li>
|
||||
<li class="next"><a
|
||||
href="/submissions/{{ next_page }}/{% if filter %}?{{ filter.name }}={{ filter.content }}{% endif %}">下一页 <span
|
||||
aria-hidden="true">→</span></a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</nav>
|
||||
{% if not submissions %}
|
||||
<p>你还没有提交记录!</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
<div class="col-md-3 col-lg-3">
|
||||
{% include "oj/announcement/_announcement_panel.html" %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -48,28 +48,28 @@
|
||||
<li><a href="/about/">关于</a></li>
|
||||
</ul>
|
||||
{% if request.user.is_authenticated %}
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
李扬
|
||||
<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="#">我的提交</a></li>
|
||||
<li><a href="#">我的资料</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="#">退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true"
|
||||
aria-expanded="false">
|
||||
{{ request.user.username }}
|
||||
<span class="caret"></span></a>
|
||||
<ul class="dropdown-menu">
|
||||
<li><a href="/submission/">我的提交</a></li>
|
||||
<li><a href="#">我的资料</a></li>
|
||||
<li role="separator" class="divider"></li>
|
||||
<li><a href="/logout/">退出</a></li>
|
||||
</ul>
|
||||
</li>
|
||||
</ul>
|
||||
{% else %}
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li class="dropdown">
|
||||
<a href="/login/" class="dropdown-toggle">
|
||||
登录
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li>
|
||||
<a href="/login/">
|
||||
登录
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
@@ -84,6 +84,10 @@
|
||||
<script src="/static/js/require.js"></script>
|
||||
<script>
|
||||
require(["bootstrap"]);
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
{% block js_block %}{% endblock %}
|
||||
<!-- footer begin -->
|
||||
|
||||
Reference in New Issue
Block a user