From 2334982f31aa0e3297d5541db81fc3dfe6a864e4 Mon Sep 17 00:00:00 2001 From: virusdefender <1670873886@qq.com> Date: Tue, 8 Sep 2015 17:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=AF=94=E8=B5=9B=E6=8E=92?= =?UTF-8?q?=E5=90=8D=E9=A1=B5=E9=9D=A2=E7=9A=84=E8=87=AA=E5=8A=A8=E5=88=B7?= =?UTF-8?q?=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- contest/views.py | 3 ++- template/src/oj/contest/contest_rank.html | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/contest/views.py b/contest/views.py index af8d4691..e68b81f5 100644 --- a/contest/views.py +++ b/contest/views.py @@ -416,4 +416,5 @@ def contest_rank_page(request, contest_id): return render(request, "oj/contest/contest_rank.html", {"contest": contest, "contest_problems": contest_problems, - "result": sorted(result, cmp=_cmp, reverse=True)}) + "result": sorted(result, cmp=_cmp, reverse=True), + "auto_refresh": request.GET.get("auto_refresh", None) == "true"}) diff --git a/template/src/oj/contest/contest_rank.html b/template/src/oj/contest/contest_rank.html index 7d17134c..ac2bb153 100644 --- a/template/src/oj/contest/contest_rank.html +++ b/template/src/oj/contest/contest_rank.html @@ -50,6 +50,7 @@ {% endfor %} + 自动刷新 {% else %}

还没有结果

{% endif %} @@ -60,4 +61,11 @@ {% block js_block %} +{% if auto_refresh %} + + {% endif %} {% endblock %} \ No newline at end of file