Reorder homepage sections

This commit is contained in:
rubenwardy 2020-07-18 01:27:23 +01:00
parent 836caf0fe0
commit 7d0a93483a
2 changed files with 10 additions and 9 deletions

@ -26,8 +26,8 @@ def home():
updated = db.session.query(Package).select_from(PackageRelease).join(Package) \
.filter_by(soft_deleted=False, approved=True) \
.order_by(db.desc(PackageRelease.releaseDate)) \
.limit(8).all()
updated = updated[:4]
.limit(20).all()
updated = updated[:8]
reviews = PackageReview.query.filter_by(recommends=True).order_by(db.desc(PackageReview.created_at)).limit(5).all()

@ -23,6 +23,13 @@
{% from "macros/packagegridtile.html" import render_pkggrid %}
<a href="{{ url_for('packages.list_all', sort='created_at', order='desc') }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Recently Added") }}</h2>
{{ render_pkggrid(new) }}
<a href="{{ url_for('packages.list_all', sort='last_release', order='desc') }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>
@ -51,13 +58,6 @@
{{ render_pkggrid(pop_txp) }}
<a href="{{ url_for('packages.list_all', sort='created_at', order='desc') }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>
<h2 class="my-3">{{ _("Recently Added") }}</h2>
{{ render_pkggrid(new) }}
<a href="{{ url_for('packages.list_reviews') }}" class="btn btn-secondary float-right">
{{ _("See more") }}
</a>
@ -65,6 +65,7 @@
{% from "macros/reviews.html" import render_reviews %}
{{ render_reviews(reviews, current_user, True) }}
<div class="text-center mt-5">
<small>
{{ _("CDB has %(count)d packages, with a total of %(downloads)d downloads.", count=count, downloads=downloads) }}