diff --git a/template/oj/contest/contest_problems_list.html b/template/oj/contest/contest_problems_list.html index 4dd68c5..2a863dd 100644 --- a/template/oj/contest/contest_problems_list.html +++ b/template/oj/contest/contest_problems_list.html @@ -41,10 +41,11 @@ {% for item in contest_problems %} - {{ item.sort_index }} + + {{ item.sort_index }} - {{ item.title }} + + {{ item.title }} {{ item|accepted_radio }} diff --git a/template/oj/contest/submissions_list.html b/template/oj/contest/submissions_list.html index 6635219..336e9c3 100644 --- a/template/oj/contest/submissions_list.html +++ b/template/oj/contest/submissions_list.html @@ -2,79 +2,83 @@ {% block body %} -{% load submission %} -
-
- -
- {% if submissions %} - - - - - - - - - - - - {% for item in submissions %} - + {% load submission %} + {% load user %} +
+
+ +
+ {% if submissions %} +
#提交时间结果运行时间语言
+ + + + + + + + + + + + {% for item in submissions %} + - {% ifequal item.user_id request.user.id %} - - {% else %} - - {% endifequal %} + {% ifequal item.user_id request.user.id %} + + {% else %} + + {% endifequal %} - - - + + + + + + + {% endfor %} + + +
#用户提交时间结果运行时间语言
- {{ forloop.counter |add:start_id }}{{ forloop.counter |add:start_id }} + {{ forloop.counter |add:start_id }}{{ forloop.counter |add:start_id }}{{ item.create_time }}{{ item.result|translate_result }} - {% if item.accepted_answer_time %} - {{ item.accepted_answer_time }}ms - {% else %} - -- + {{ item.user_id|get_username }}{{ item.create_time }}{{ item.result|translate_result }} + {% if item.accepted_answer_time %} + {{ item.accepted_answer_time }}ms + {% else %} + -- + {% endif %} + + {{ item.language|translate_language }} +
+ {% else %} +

你还没有提交记录!

+ {% endif %} +
+ {% if next_page %} + + {% endif %} + + + {% endblock %} diff --git a/utils/templatetags/user.py b/utils/templatetags/user.py new file mode 100644 index 0000000..4a81de5 --- /dev/null +++ b/utils/templatetags/user.py @@ -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) +