pull/105/head
parent
a1454a6845
commit
4a1a66120f
|
@ -23,7 +23,7 @@ def submit_marseys(v:User):
|
||||||
else:
|
else:
|
||||||
marseys = g.db.query(Marsey).filter(Marsey.submitter_id == v.id)
|
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:
|
for marsey in marseys:
|
||||||
marsey.author = g.db.query(User.username).filter_by(id=marsey.author_id).one()[0]
|
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):
|
def submit_hats(v:User):
|
||||||
if v.admin_level >= PERMS['VIEW_PENDING_SUBMITTED_HATS']: hats = g.db.query(HatDef).filter(HatDef.submitter_id != None)
|
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)
|
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)
|
return render_template("submit_hats.html", v=v, hats=hats)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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 %}>
|
<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>
|
</div>
|
||||||
<div class="d-flex my-4 mx-3">
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %}
|
||||||
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this, '{{hat.name}}')">Remove</button>
|
<div class="d-flex my-4 mx-3">
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this, '{{hat.name}}')">Remove</button>
|
||||||
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this, '{{hat.name}}')">Approve</button>
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
||||||
{% endif %}
|
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this, '{{hat.name}}')">Approve</button>
|
||||||
</div>
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -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 %}>
|
<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>
|
</div>
|
||||||
<div class="d-flex my-4 mx-3">
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == marsey.submitter_id %}
|
||||||
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_marsey(this, '{{marsey.name}}')">Remove</button>
|
<div class="d-flex my-4 mx-3">
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_marsey(this, '{{marsey.name}}')">Remove</button>
|
||||||
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_marsey(this, '{{marsey.name}}')">Approve</button>
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
||||||
{% endif %}
|
<button type="button" class="btn btn-primary ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_marsey(this, '{{marsey.name}}')">Approve</button>
|
||||||
</div>
|
{% endif %}
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue