aboutsummaryrefslogtreecommitdiff
path: root/app/blueprints
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-18 02:48:22 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-18 02:48:22 +0100
commit68a132f271b04eb7c1812609c6be4f78960fad22 (patch)
tree0bfc0ec08ba691ff453215258182051e07587b2d /app/blueprints
parentc7b1dcec4f3f924ad300ddb662eb573b1677c979 (diff)
downloadcheatdb-68a132f271b04eb7c1812609c6be4f78960fad22.tar.xz
Add tags list to homepage
Diffstat (limited to 'app/blueprints')
-rw-r--r--app/blueprints/homepage/__init__.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/app/blueprints/homepage/__init__.py b/app/blueprints/homepage/__init__.py
index f029fde..85f6686 100644
--- a/app/blueprints/homepage/__init__.py
+++ b/app/blueprints/homepage/__init__.py
@@ -34,5 +34,8 @@ def home():
downloads_result = db.session.query(func.sum(Package.downloads)).one_or_none()
downloads = 0 if not downloads_result or not downloads_result[0] else downloads_result[0]
- return render_template("index.html", count=count, downloads=downloads, \
+ tags = db.session.query(func.count(Tags.c.tag_id), Tag) \
+ .select_from(Tag).outerjoin(Tags).group_by(Tag.id).order_by(db.asc(Tag.title)).all()
+
+ return render_template("index.html", count=count, downloads=downloads, tags=tags, \
new=new, updated=updated, pop_mod=pop_mod, pop_txp=pop_txp, pop_gam=pop_gam, reviews=reviews)