add name sort to marseys and disable clicking on "marsey" and "original file"

pull/146/head
Aevann 2023-05-05 07:16:05 +03:00
parent 3449dcf5d2
commit c854b65e8b
2 changed files with 6 additions and 4 deletions

View File

@ -58,8 +58,10 @@ def marseys(v:User):
sort = request.values.get("sort")
if sort == "author":
marseys = marseys.order_by(User.username, Emoji.count.desc())
elif sort == "name":
marseys = marseys.order_by(Emoji.name, Emoji.count.desc())
elif sort == "added_on":
marseys = marseys.order_by(nullslast(Emoji.created_utc.desc()), User.username)
marseys = marseys.order_by(nullslast(Emoji.created_utc.desc()), Emoji.count.desc())
else: # implied sort == "usage"
marseys = marseys.order_by(Emoji.count.desc(), User.username)

View File

@ -5,15 +5,15 @@
<div class="overflow-x-auto mt-3"><table class="table table-striped mb-5">
<thead class="bg-primary text-white">
<tr>
<th>Name</th>
<th>Marsey</th>
<th class="disable-sort-click" {% if sort=="name" %}disabled{% endif %}><a href="?sort=name">Name</a></th>
<th class="disable-sort-click">Marsey</th>
<th class="disable-sort-click" {% if sort=="usage" %}disabled{% endif %}><a href="/marseys">Usage</a></th>
{% if FEATURES['ASSET_SUBMISSIONS'] %}
<th class="disable-sort-click" {% if sort=="author" %}disabled{% endif %}><a href="?sort=author">Author</a></th>
{% endif %}
<th class="disable-sort-click" {% if sort=="added_on" %}disabled{% endif %}><a href="?sort=added_on">Added on</a></th>
{% if FEATURES['ASSET_SUBMISSIONS'] %}
<th>Original File</th>
<th class="disable-sort-click">Original File</th>
{% endif %}
</tr>
</thead>