mirror of
https://github.com/minetest/contentdb.git
synced 2024-12-22 22:12:24 +01:00
Default to sort=score on All Outdated Packages
This commit is contained in:
parent
a67e3af172
commit
324815d58d
@ -180,10 +180,11 @@ def outdated():
|
||||
.filter(Package.state == PackageState.APPROVED)
|
||||
|
||||
sort_by = request.args.get("sort")
|
||||
if sort_by == "score":
|
||||
query = query.order_by(db.desc(Package.score))
|
||||
else:
|
||||
if sort_by == "date":
|
||||
query = query.order_by(db.desc(PackageUpdateConfig.outdated_at))
|
||||
else:
|
||||
sort_by = "score"
|
||||
query = query.order_by(db.desc(Package.score))
|
||||
|
||||
return render_template("todo/outdated.html", current_tab="outdated",
|
||||
outdated_packages=query.all(), sort_by=sort_by)
|
||||
|
@ -6,7 +6,7 @@
|
||||
|
||||
{% block content %}
|
||||
<div class="btn-group btn-group-sm float-right">
|
||||
<a class="btn btn-secondary {% if sort_by != 'score' %}active{% endif %}"
|
||||
<a class="btn btn-secondary {% if sort_by == 'date' %}active{% endif %}"
|
||||
href="{{ url_set_query(sort='date') }}">
|
||||
Sort by date
|
||||
</a>
|
||||
|
Loading…
Reference in New Issue
Block a user