mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-23 06:22:24 +01:00
Fix package count on home page
This commit is contained in:
parent
149b43a013
commit
3565058eea
@ -11,7 +11,7 @@ Welcome
|
||||
|
||||
<p>
|
||||
Minetest's official content repository.
|
||||
Browse {{ packages | length }} packages,
|
||||
Browse {{ count }} packages,
|
||||
all available under a free and open source
|
||||
license.
|
||||
</p>
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user