diff --git a/app/templates/index.html b/app/templates/index.html index fee35db..41a3990 100644 --- a/app/templates/index.html +++ b/app/templates/index.html @@ -11,7 +11,7 @@ Welcome

Minetest's official content repository. - Browse {{ packages | length }} packages, + Browse {{ count }} packages, all available under a free and open source license.

diff --git a/app/views/__init__.py b/app/views/__init__.py index 28fb518..37474de 100644 --- a/app/views/__init__.py +++ b/app/views/__init__.py @@ -43,8 +43,10 @@ def send_upload(path): @app.route("/") @menu.register_menu(app, ".", "Home") def home_page(): - packages = Package.query.filter_by(approved=True).order_by(db.desc(Package.created_at)).limit(15).all() - return render_template("index.html", packages=packages) + query = Package.query.filter_by(approved=True) + count = query.count() + packages = query.order_by(db.desc(Package.created_at)).limit(15).all() + return render_template("index.html", packages=packages, count=count) from . import users, githublogin, packages, sass, tasks, admin, notifications