From eddbf6726d96fce92e381a2f5f0040079ce479be Mon Sep 17 00:00:00 2001 From: BuckFromRdrama <98723184+BuckFromRdrama@users.noreply.github.com> Date: Tue, 1 Feb 2022 17:59:57 -0500 Subject: [PATCH] Shop discount QoL (#195) --- files/routes/awards.py | 1 + files/templates/shop.html | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/files/routes/awards.py b/files/routes/awards.py index 81e5501b0..66ecf6a41 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -76,6 +76,7 @@ def shop(v): if v.has_badge(badge): discount -= discounts[badge] for val in AWARDS.values(): + val["baseprice"] = int(val["price"]) val["price"] = int(val["price"]*discount) sales = g.db.query(func.sum(User.coins_spent)).scalar() diff --git a/files/templates/shop.html b/files/templates/shop.html index 322c8a39f..a4aaa36fb 100644 --- a/files/templates/shop.html +++ b/files/templates/shop.html @@ -60,7 +60,12 @@ {{a['title']}} + {% if a['baseprice'] != a['price'] %} + {{a['baseprice']}} {{a['price']}} + {% endif %} + {% if a['baseprice'] == a['price'] %} {{a['price']}} + {% endif %} {{a['owned']}} {% set kind = a['kind'] %}