From aefcaf4311c7b9ae628b908d054615b032e6055b Mon Sep 17 00:00:00 2001 From: ZaneYork Date: Thu, 12 Sep 2024 18:00:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dinner.py | 2 +- templates/dinner.html | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/dinner.py b/src/dinner.py index 0d8adac..990675a 100644 --- a/src/dinner.py +++ b/src/dinner.py @@ -97,7 +97,7 @@ def dinner_update(): if not nickname: return make_response(json.dumps(dict(code=-1, data="姓名必须填写"))) if not is_valid_user(nickname): - abort(403) + return make_response(json.dumps(dict(code=-1, data="你不能投票(*^_^*)"))) if not user_menu: set_user_menu('', nickname) return make_response(json.dumps(dict(code=0, data="OK"))) diff --git a/templates/dinner.html b/templates/dinner.html index 6d92733..d8c413d 100644 --- a/templates/dinner.html +++ b/templates/dinner.html @@ -8,16 +8,16 @@

每天8:00-17:30间开放匿名投票更新,17:30以后允许发起抽签,抽签结果确定后不可更改

第一名与第二名得票数相差不超过10%时随机抽签,按其得票数决定中签概率,否则选择第一名

+

投票结果仅供参考,最终解释权归部门总经理、副总经理所有

{% for last_result in last_results %}

今日{{ last_result }}最终得票数降低{{ 2 + loop.index0 }}0%

{% endfor %}
- 姓名 - + +
我选择 @@ -39,14 +39,14 @@
    {% for key in summary_keys %} -
  • +
  • {{ key }} {{ '{:.2f}'.format(summary[key] | round(2)) }}票 @@ -89,6 +89,11 @@