aboutsummaryrefslogtreecommitdiff
path: root/app/blueprints/packages/packages.py
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2020-07-12 20:10:19 +0100
committerrubenwardy <rw@rubenwardy.com>2020-07-12 20:10:19 +0100
commitae4352068ef6f3e014be6695cbddcf914013fd1b (patch)
tree09cfc248eeb1e21dfd32febf553f62b9687fd9e5 /app/blueprints/packages/packages.py
parent2faa0e42195fdf46ff6e647c250da7d438798c59 (diff)
downloadcheatdb-ae4352068ef6f3e014be6695cbddcf914013fd1b.tar.xz
Add tag filter list to package page
Diffstat (limited to 'app/blueprints/packages/packages.py')
-rw-r--r--app/blueprints/packages/packages.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/app/blueprints/packages/packages.py b/app/blueprints/packages/packages.py
index 53bd3b0..0cb9b35 100644
--- a/app/blueprints/packages/packages.py
+++ b/app/blueprints/packages/packages.py
@@ -80,12 +80,15 @@ def list_all():
qb.show_discarded = True
topics = qb.buildTopicQuery().all()
- tags = Tag.query.all()
+ 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))
+
+ selected_tags = set(qb.tags)
+
return render_template("packages/list.html", \
- title=title, packages=query.items, topics=topics, \
- query=search, tags=tags, type=type_name, \
- authors=authors, packages_count=query.total, \
- pagination=query)
+ title=title, packages=query.items, pagination=query, \
+ query=search, tags=tags, selected_tags=selected_tags, type=type_name, \
+ authors=authors, packages_count=query.total, topics=topics)
def getReleases(package):