Aevann 2023-01-29 15:51:34 +02:00
parent a1454a6845
commit 4a1a66120f
3 changed files with 18 additions and 14 deletions

View File

@ -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)

View File

@ -86,12 +86,14 @@
<input autocomplete="off" type="number" id="{{hat.name}}-price" class="form-control" name="price" min="0" value="{{hat.price}}" placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
</div>
</div>
<div class="d-flex my-4 mx-3">
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this, '{{hat.name}}')">Remove</button>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this, '{{hat.name}}')">Approve</button>
{% endif %}
</div>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %}
<div class="d-flex my-4 mx-3">
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this, '{{hat.name}}')">Remove</button>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this, '{{hat.name}}')">Approve</button>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>

View File

@ -72,12 +72,14 @@
<input autocomplete="off" type="text" id="{{marsey.name}}-tags" class="form-control" name="tags" maxlength="200" value="{{marsey.tags}}" pattern='[a-z0-9: ]{1,200}' placeholder="Required" required {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}readonly{% endif %}>
</div>
</div>
<div class="d-flex my-4 mx-3">
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_marsey(this, '{{marsey.name}}')">Remove</button>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_marsey(this, '{{marsey.name}}')">Approve</button>
{% endif %}
</div>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == marsey.submitter_id %}
<div class="d-flex my-4 mx-3">
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_marsey(this, '{{marsey.name}}')">Remove</button>
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_marsey(this, '{{marsey.name}}')">Approve</button>
{% endif %}
</div>
{% endif %}
</div>
{% endfor %}
</div>