From 44f9ea862c322bb2a100fde5f1bb7423dc7076eb Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Sat, 22 Aug 2015 21:03:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=88=AA=E6=A0=8F?= =?UTF-8?q?=E7=9A=84=20url=EF=BC=9B=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E9=A1=BA=E5=BA=8F=E9=A1=BA=E5=BA=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- submission/views.py | 4 +- .../oj/submission/my_submissions_list.html | 110 ++++++++---------- template/oj_base.html | 2 +- 3 files changed, 54 insertions(+), 62 deletions(-) diff --git a/submission/views.py b/submission/views.py index 792660a8..ab8fb712 100644 --- a/submission/views.py +++ b/submission/views.py @@ -117,7 +117,7 @@ class SubmissionAdminAPIView(APIView): @login_required def my_submission_list_page(request, page=1): submissions = Submission.objects.filter(user_id=request.user.id). \ - values("id", "result", "create_time", "accepted_answer_time", "language") + values("id", "result", "create_time", "accepted_answer_time", "language").order_by("-create_time") paginator = Paginator(submissions, 20) try: current_page = paginator.page(int(page)) @@ -135,4 +135,4 @@ def my_submission_list_page(request, page=1): return render(request, "oj/submission/my_submissions_list.html", {"submissions": current_page, "page": int(page), - "previous_page": previous_page, "next_page": next_page, "startId":int(page)*20-20}) + "previous_page": previous_page, "next_page": next_page, "start_id": int(page) * 20 - 20}) diff --git a/template/oj/submission/my_submissions_list.html b/template/oj/submission/my_submissions_list.html index c6fcacb0..4b939ece 100644 --- a/template/oj/submission/my_submissions_list.html +++ b/template/oj/submission/my_submissions_list.html @@ -2,65 +2,57 @@ {% block body %} -{% load submission %} -
# | +提交时间 | +结果 | +运行时间 | +语言 | +
---|---|---|---|---|
+ {{ forloop.counter |add:start_id }} | +{{ item.create_time }} | +{{ item.result|translate_result }} | ++ {% if item.accepted_answer_time %} + {{ item.accepted_answer_time }}ms + {% else %} + -- + {% endif %} + | ++ {{ item.language|translate_language }} + | +
# | -提交时间 | -结果 | -运行时间 | -语言 | -
---|---|---|---|---|
- {{ forloop.counter |add:startId }} | -{{ item.create_time }} | -{{ item.result|translate_result }} | -- {% if item.accepted_answer_time %} - {{ item.accepted_answer_time }}ms - {% else %} - -- + |
你还没有提交记录!
+ {% endif %} + -你还没有提交记录!
- {% endif %} - -