From 1ce1410268088544dc4479a1798839fc71f93c42 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 8 Sep 2022 20:36:43 +0200 Subject: [PATCH] show total number of hats in /hats --- files/routes/hats.py | 3 ++- files/templates/hats.html | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/files/routes/hats.py b/files/routes/hats.py index 904cfa14f..bd73cff7b 100644 --- a/files/routes/hats.py +++ b/files/routes/hats.py @@ -29,7 +29,8 @@ def hats(v): hats = owned + not_owned sales = g.db.query(func.sum(User.coins_spent_on_hats)).scalar() - return render_template("hats.html", owned_hat_ids=owned_hat_ids, hats=hats, v=v, sales=sales) + num_of_hats = g.db.query(HatDef).count() + return render_template("hats.html", owned_hat_ids=owned_hat_ids, hats=hats, v=v, sales=sales, num_of_hats=num_of_hats) @app.post("/buy_hat/") @auth_required diff --git a/files/templates/hats.html b/files/templates/hats.html index d89870bfe..225c77217 100644 --- a/files/templates/hats.html +++ b/files/templates/hats.html @@ -21,6 +21,7 @@
Number of hats you designed: {{v.num_of_designed_hats}}
Coins you spent on hats: {{v.coins_spent_on_hats}}
Total hat sales: {{sales}}
+
Number of hats: {{num_of_hats}}
{% endblock %}