整理格式,增加提交列表的用户名
This commit is contained in:
@@ -41,10 +41,11 @@
|
|||||||
{% for item in contest_problems %}
|
{% for item in contest_problems %}
|
||||||
<tr>
|
<tr>
|
||||||
<th><span class="glyphicon glyphicon-ok ac-flag"></span></th>
|
<th><span class="glyphicon glyphicon-ok ac-flag"></span></th>
|
||||||
<th scope="row"><a
|
<th scope="row">
|
||||||
href="/contest/{{ item.contest.id }}/problem/{{ item.id }}/">{{ item.sort_index }}</a>
|
<a href="/contest/{{ item.contest.id }}/problem/{{ item.id }}/" target="_blank">{{ item.sort_index }}</a>
|
||||||
</th>
|
</th>
|
||||||
<td><a href="/contest/{{ item.contest.id }}/problem/{{ item.id }}/">{{ item.title }}</a>
|
<td>
|
||||||
|
<a href="/contest/{{ item.contest.id }}/problem/{{ item.id }}/" target="_blank">{{ item.title }}</a>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ item|accepted_radio }}</td>
|
<td>{{ item|accepted_radio }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@@ -2,8 +2,9 @@
|
|||||||
|
|
||||||
{% block body %}
|
{% block body %}
|
||||||
|
|
||||||
{% load submission %}
|
{% load submission %}
|
||||||
<div class="container main">
|
{% load user %}
|
||||||
|
<div class="container main">
|
||||||
<div class="contest-tab">
|
<div class="contest-tab">
|
||||||
<ul class="nav nav-tabs nav-tabs-google">
|
<ul class="nav nav-tabs nav-tabs-google">
|
||||||
<li role="presentation">
|
<li role="presentation">
|
||||||
@@ -25,6 +26,7 @@
|
|||||||
<thead>
|
<thead>
|
||||||
<tr class="" success>
|
<tr class="" success>
|
||||||
<th>#</th>
|
<th>#</th>
|
||||||
|
<td>用户</td>
|
||||||
<th>提交时间</th>
|
<th>提交时间</th>
|
||||||
<th>结果</th>
|
<th>结果</th>
|
||||||
<th>运行时间</th>
|
<th>运行时间</th>
|
||||||
@@ -42,6 +44,8 @@
|
|||||||
<th scope="row">{{ forloop.counter |add:start_id }}</th>
|
<th scope="row">{{ forloop.counter |add:start_id }}</th>
|
||||||
{% endifequal %}
|
{% endifequal %}
|
||||||
|
|
||||||
|
<td>{{ item.user_id|get_username }}</td>
|
||||||
|
|
||||||
<td>{{ item.create_time }}</td>
|
<td>{{ item.create_time }}</td>
|
||||||
<td>{{ item.result|translate_result }}</td>
|
<td>{{ item.result|translate_result }}</td>
|
||||||
<td>
|
<td>
|
||||||
@@ -76,5 +80,5 @@
|
|||||||
{% endif %}
|
{% endif %}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|||||||
17
utils/templatetags/user.py
Normal file
17
utils/templatetags/user.py
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# coding=utf-8
|
||||||
|
import datetime
|
||||||
|
from account.models import User
|
||||||
|
|
||||||
|
|
||||||
|
def get_username(user_id):
|
||||||
|
try:
|
||||||
|
return User.objects.get(id=user_id).username
|
||||||
|
except User.DoesNotExist:
|
||||||
|
return ""
|
||||||
|
|
||||||
|
|
||||||
|
from django import template
|
||||||
|
|
||||||
|
register = template.Library()
|
||||||
|
register.filter("get_username", get_username)
|
||||||
|
|
||||||
Reference in New Issue
Block a user