mirror of
https://github.com/minetest/contentdb.git
synced 2025-01-03 19:57:29 +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>
|
<main>
|
||||||
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
{% from "macros/packagegridtile.html" import render_pkggrid %}
|
||||||
<h2>Newly Added</h2>
|
|
||||||
{{ render_pkggrid(new) }}
|
|
||||||
|
|
||||||
<h2>Popular</h2>
|
<h2>Popular</h2>
|
||||||
{{ render_pkggrid(popular) }}
|
{{ 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>
|
</main>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
@ -46,10 +46,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():
|
||||||
query = Package.query.filter_by(approved=True, soft_deleted=False)
|
query = Package.query.filter_by(approved=True, soft_deleted=False)
|
||||||
count = query.count()
|
count = query.count()
|
||||||
new = query.order_by(db.desc(Package.created_at)).limit(3).all()
|
new = query.order_by(db.desc(Package.created_at)).limit(15).all()
|
||||||
popular = query.order_by(db.desc(Package.score)).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)
|
return render_template("index.html", new=new, popular=popular, count=count)
|
||||||
|
|
||||||
from . import users, githublogin, packages, meta, threads, api
|
from . import users, githublogin, packages, meta, threads, api
|
||||||
|
Loading…
Reference in New Issue
Block a user