From 5f40d6844173d6d7b65a1ec5b73ab83d4ef67073 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 22 Dec 2018 21:03:01 +0000 Subject: Improve home page --- app/views/__init__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'app/views') diff --git a/app/views/__init__.py b/app/views/__init__.py index 6c19b0c..b53361b 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -48,9 +48,10 @@ def send_upload(path): def home_page(): query = Package.query.filter_by(approved=True, soft_deleted=False) count = query.count() - new = query.order_by(db.desc(Package.created_at)).limit(12).all() + new = query.order_by(db.desc(Package.created_at)).limit(8).all() popular = query.order_by(db.desc(Package.score)).limit(8).all() - return render_template("index.html", new=new, popular=popular, count=count) + pop_txp = query.filter_by(type=PackageType.TXP).order_by(db.desc(Package.score)).limit(4).all() + return render_template("index.html", new=new, popular=popular, count=count, pop_txp=pop_txp) from . import users, githublogin, packages, meta, threads, api from . import tasks, admin, notifications, tagseditor, licenseseditor -- cgit v1.2.3