mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 09:33:44 +01:00
Fix package count on home page
This commit is contained in:
parent
149b43a013
commit
3565058eea
@ -11,7 +11,7 @@ Welcome
|
|||||||
|
|
||||||
<p>
|
<p>
|
||||||
Minetest's official content repository.
|
Minetest's official content repository.
|
||||||
Browse {{ packages | length }} packages,
|
Browse {{ count }} packages,
|
||||||
all available under a free and open source
|
all available under a free and open source
|
||||||
license.
|
license.
|
||||||
</p>
|
</p>
|
||||||
|
@ -43,8 +43,10 @@ def send_upload(path):
|
|||||||
@app.route("/")
|
@app.route("/")
|
||||||
@menu.register_menu(app, ".", "Home")
|
@menu.register_menu(app, ".", "Home")
|
||||||
def home_page():
|
def home_page():
|
||||||
packages = Package.query.filter_by(approved=True).order_by(db.desc(Package.created_at)).limit(15).all()
|
query = Package.query.filter_by(approved=True)
|
||||||
return render_template("index.html", packages=packages)
|
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
|
from . import users, githublogin, packages, sass, tasks, admin, notifications
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user