From 975096147b23050ed2d39bef6938affac44c6082 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Wed, 8 Sep 2021 10:57:40 +0200 Subject: [PATCH] gf --- files/routes/awards.py | 5 +++-- files/templates/shop.html | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 7b5f5a5e1..ead22d2b6 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -68,10 +68,11 @@ def shop(v): for row in (r._asdict() for r in query): kind = row['last_award_kind'] if kind in AWARDS.keys(): - owned.append((AWARDS[kind], row['last_award_count'])) + award = AWARDS[kind] + award["owned_num"] = row['last_award_count'] print(owned) - return render_template("shop.html", owned=owned.values(), awards=list(AWARDS.values()), v=v) + return render_template("shop.html", owned=owned, awards=list(AWARDS.values()), v=v) @app.post("/buy/") @auth_required diff --git a/files/templates/shop.html b/files/templates/shop.html index ff776d7a0..8f7980c0b 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -33,23 +33,26 @@

 

-
Owned
+
Owned Awards
+ + -{% for a in awards %} +{% for a in owned %} + - {% set kind = a['kind'] %} + {% endfor %}
Icon TitleDescription NumberOwned
{{a['title']}}{{a['description']}} {{a['price']}}{{a['owned_num']}}
@@ -66,6 +69,7 @@ Icon Title + Description Price Buy @@ -75,6 +79,7 @@ {{a['title']}} + {{a['description']}} {{a['price']}} {% set kind = a['kind'] %} Buy