From b1f60133704bfad26f22898b32cb2fbffca51f4b Mon Sep 17 00:00:00 2001 From: ZaneYork Date: Wed, 11 Sep 2024 15:51:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E5=BA=8F=E5=B1=95=E7=A4=BA=EF=BC=8C?= =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=98=BE=E7=A4=BA=E5=BD=93=E5=89=8D=E6=AF=94?= =?UTF-8?q?=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/dinner.py | 2 ++ templates/dinner.html | 31 +++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/dinner.py b/src/dinner.py index 6f072e9..bb66bba 100644 --- a/src/dinner.py +++ b/src/dinner.py @@ -156,10 +156,12 @@ def dinner(): result = fetch_roll_result() can_roll = (check_roll() == 1) all_choice = list(map(lambda x: {'name': x[0], 'label': x[1]}, fetch_all_menu())) + summary_keys = list(filter(lambda x: x in summary.keys(), map(lambda y: y['name'], all_choice))) return render_template('dinner.html', all_choice=all_choice, menu=menu, summary=summary, + summary_keys=summary_keys, total_vote=total_vote, result=result, can_roll=can_roll, diff --git a/templates/dinner.html b/templates/dinner.html index 840b216..c2e4222 100644 --- a/templates/dinner.html +++ b/templates/dinner.html @@ -18,11 +18,14 @@ {% for choice in all_choice %}
- - + +
{% endfor %} @@ -36,7 +39,7 @@