From 4a1a66120f5e6936537b9f4e4d9c5c628d60ad9c Mon Sep 17 00:00:00 2001 From: Aevann Date: Sun, 29 Jan 2023 15:51:34 +0200 Subject: [PATCH] fix this https://stupidpol.site/post/18459/marseycapywalking-megathread-for-bugs-and-suggestions/3500512#context --- files/routes/asset_submissions.py | 4 ++-- files/templates/submit_hats.html | 14 ++++++++------ files/templates/submit_marseys.html | 14 ++++++++------ 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/files/routes/asset_submissions.py b/files/routes/asset_submissions.py index 3cb280cb4..71382296c 100644 --- a/files/routes/asset_submissions.py +++ b/files/routes/asset_submissions.py @@ -23,7 +23,7 @@ def submit_marseys(v:User): else: marseys = g.db.query(Marsey).filter(Marsey.submitter_id == v.id) - marseys = marseys.order_by(Marsey.created_utc).all() + marseys = marseys.order_by(Marsey.created_utc.desc()).all() for marsey in marseys: marsey.author = g.db.query(User.username).filter_by(id=marsey.author_id).one()[0] @@ -199,7 +199,7 @@ def remove_marsey(v:User, name): def submit_hats(v:User): if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_HATS']: hats = g.db.query(HatDef).filter(HatDef.submitter_id != None) else: hats = g.db.query(HatDef).filter(HatDef.submitter_id == v.id) - hats = hats.order_by(HatDef.created_utc).all() + hats = hats.order_by(HatDef.created_utc.desc()).all() return render_template("submit_hats.html", v=v, hats=hats) diff --git a/files/templates/submit_hats.html b/files/templates/submit_hats.html index 8a360c5ec..8b3093ef7 100644 --- a/files/templates/submit_hats.html +++ b/files/templates/submit_hats.html @@ -86,12 +86,14 @@ -
- - {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %} - - {% endif %} -
+ {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %} +
+ + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %} + + {% endif %} +
+ {% endif %} {% endfor %} diff --git a/files/templates/submit_marseys.html b/files/templates/submit_marseys.html index 408768b18..f1c357aba 100644 --- a/files/templates/submit_marseys.html +++ b/files/templates/submit_marseys.html @@ -72,12 +72,14 @@ -
- - {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %} - - {% endif %} -
+ {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == marsey.submitter_id %} +
+ + {% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %} + + {% endif %} +
+ {% endif %} {% endfor %}