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