mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 09:33:44 +01:00
Reorder new and popular, change number of packages in each
This commit is contained in:
parent
7813c766ac
commit
a6c8b12cdd
@ -25,10 +25,14 @@ Welcome
|
||||
|
||||
<main>
|
||||
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
||||
<h2>Newly Added</h2>
|
||||
{{ render_pkggrid(new) }}
|
||||
|
||||
<h2>Popular</h2>
|
||||
{{ render_pkggrid(popular) }}
|
||||
|
||||
<a href="{{ url_for('packages_page') }}" class="button">Show More</a>
|
||||
|
||||
<h2 style="margin-top:2em;">Newly Added</h2>
|
||||
{{ render_pkggrid(new) }}
|
||||
|
||||
</main>
|
||||
{% endblock %}
|
||||
|
@ -46,10 +46,10 @@ def send_upload(path):
|
||||
@app.route("/")
|
||||
@menu.register_menu(app, ".", "Home")
|
||||
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(3).all()
|
||||
popular = query.order_by(db.desc(Package.score)).limit(15).all()
|
||||
query = Package.query.filter_by(approved=True, soft_deleted=False)
|
||||
count = query.count()
|
||||
new = query.order_by(db.desc(Package.created_at)).limit(15).all()
|
||||
popular = query.order_by(db.desc(Package.score)).limit(6).all()
|
||||
return render_template("index.html", new=new, popular=popular, count=count)
|
||||
|
||||
from . import users, githublogin, packages, meta, threads, api
|
||||
|
Loading…
Reference in New Issue
Block a user