From 34f886d99041a3a6d901cfc6ff7baabe667584ef Mon Sep 17 00:00:00 2001 From: "sxw@401" Date: Sun, 13 Sep 2015 21:03:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dtypo,=E4=BF=AE=E6=94=B9rank?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contest/views.py | 5 ++-- static/src/css/oj.css | 12 +-------- template/src/oj/contest/contest_rank.html | 32 +++++++---------------- 3 files changed, 13 insertions(+), 36 deletions(-) diff --git a/contest/views.py b/contest/views.py index 3ea33e6..a5a45c4 100644 --- a/contest/views.py +++ b/contest/views.py @@ -396,7 +396,6 @@ def _cmp(x, y): def contest_rank_page(request, contest_id): contest = Contest.objects.get(id=contest_id) contest_problems = ContestProblem.objects.filter(contest=contest).order_by("sort_index") - r = redis.Redis(host=REDIS_CACHE["host"], port=REDIS_CACHE["port"], db=REDIS_CACHE["db"]) if contest.real_time_rank: # 更新rank @@ -411,12 +410,12 @@ def contest_rank_page(request, contest_id): try: status = submissions.get(problem=problem) result[i]["problems"].append({ - "first_achieved":status.first_achivevd, + "first_achieved":status.first_achieved, "ac": status.ac, "failed_number": status.total_submission_number, "ac_time": status.ac_time}) if status.ac: - result[i]["problem"][-1].failed_number -= 1 + result[i]["problems"][-1]["failed_number"] -= 1 except ContestSubmission.DoesNotExist: result[i]["problems"].append({}) result[i]["total_ac"] = submissions.filter(ac=True).count() diff --git a/static/src/css/oj.css b/static/src/css/oj.css index 04f9da2..86748c2 100644 --- a/static/src/css/oj.css +++ b/static/src/css/oj.css @@ -110,16 +110,6 @@ li.list-group-item { } .rank .first-achieved{ - background: #43CD80; - color: white; + background: #33CC99; } -.rank .ac{ - background: #3c763d; - color: white; -} - -.rank .failed{ - background: #a94442; - color: white; -} \ No newline at end of file diff --git a/template/src/oj/contest/contest_rank.html b/template/src/oj/contest/contest_rank.html index a23ff9c..62faf0b 100644 --- a/template/src/oj/contest/contest_rank.html +++ b/template/src/oj/contest/contest_rank.html @@ -25,18 +25,18 @@ 实时 {% else %} 已封榜 - {% endif %}) - - {% if result %} - + {% endif %}) + + {% if result %} +
- - - + + + {% for item in contest_problems %} - {% endfor %} @@ -48,20 +48,8 @@ - {% for problem in item.problem %} -
#用户名AC / 总提交用时 + 罚时用户名AC / 总提交用时 + 罚时{{ item.sort_index }} + {{ item.sort_index }}
{{ item.username }} {{ item.total_ac }} / {{ item.total_submit }} {% if item.total_time %}{{ item.total_time }} min{% else %}--{% endif %} + {% for problem in item.problems %} + {% if problem.ac %} {{ problem.ac_time }}min {% endif %}