forked from rDrama/rDrama
add asset reject reason
parent
4d2b7be757
commit
00ffbfe3d4
|
@ -7035,9 +7035,6 @@ div.markdown {
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
margin-top: 5px;
|
margin-top: 5px;
|
||||||
}
|
}
|
||||||
.btn:not(.format) {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
.giphy {
|
.giphy {
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
|
@ -15,6 +15,7 @@ function approve_emoji(t, name) {
|
||||||
function remove_emoji(t, name) {
|
function remove_emoji(t, name) {
|
||||||
postToast(t, `/remove/emoji/${name}`,
|
postToast(t, `/remove/emoji/${name}`,
|
||||||
{
|
{
|
||||||
|
"reason": document.getElementById(`${name}-reason`).value,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
document.getElementById(`${name}-emoji`).remove()
|
document.getElementById(`${name}-emoji`).remove()
|
||||||
|
|
|
@ -16,6 +16,7 @@ function remove_hat(t) {
|
||||||
const name = t.dataset.name
|
const name = t.dataset.name
|
||||||
postToast(t, `/remove/hat/${name}`,
|
postToast(t, `/remove/hat/${name}`,
|
||||||
{
|
{
|
||||||
|
"reason": document.getElementById(`${name}-reason`).value,
|
||||||
},
|
},
|
||||||
() => {
|
() => {
|
||||||
document.getElementById(`${name}-hat`).remove()
|
document.getElementById(`${name}-hat`).remove()
|
||||||
|
|
|
@ -245,7 +245,10 @@ def remove_asset(cls, type_name, v, name):
|
||||||
name = asset.name
|
name = asset.name
|
||||||
|
|
||||||
if v.id != asset.submitter_id:
|
if v.id != asset.submitter_id:
|
||||||
|
reason = request.values.get("reason")
|
||||||
msg = f"@{v.username} has rejected a {type_name} you submitted: `'{name}'`"
|
msg = f"@{v.username} has rejected a {type_name} you submitted: `'{name}'`"
|
||||||
|
if reason:
|
||||||
|
msg += f"\nReason: `{reason}`"
|
||||||
send_repeatable_notification(asset.submitter_id, msg)
|
send_repeatable_notification(asset.submitter_id, msg)
|
||||||
|
|
||||||
ma = ModAction(
|
ma = ModAction(
|
||||||
|
|
|
@ -109,9 +109,11 @@
|
||||||
</div>
|
</div>
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == emoji.submitter_id %}
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == emoji.submitter_id %}
|
||||||
<div class="d-flex my-4 mx-3">
|
<div class="d-flex my-4 mx-3">
|
||||||
|
<input autocomplete="off" type="text" id="{{emoji.name}}-reason" class="form-control mr-4" name="reason" placeholder="Rejection reason..." maxlength="500" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}hidden{% endif %}>
|
||||||
|
|
||||||
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_emoji(this, '{{emoji.name}}')">Remove</button>
|
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_emoji(this, '{{emoji.name}}')">Remove</button>
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
||||||
<button type="button" class="btn btn-success ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_emoji(this, '{{emoji.name}}')">Approve</button>
|
<button type="button" class="btn btn-success ml-3 mr-1" data-nonce="{{g.nonce}}" data-onclick="approve_emoji(this, '{{emoji.name}}')">Approve</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
@ -82,9 +82,11 @@
|
||||||
</div>
|
</div>
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %}
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] or v.id == hat.submitter_id %}
|
||||||
<div class="d-flex my-4 mx-3">
|
<div class="d-flex my-4 mx-3">
|
||||||
|
<input autocomplete="off" type="text" id="{{hat.name}}-reason" class="form-control mr-4" name="reason" placeholder="Rejection reason..." maxlength="500" {% if v.admin_level < PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}hidden{% endif %}>
|
||||||
|
|
||||||
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this)" data-name="{{hat.name}}">Remove</button>
|
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this)" data-name="{{hat.name}}">Remove</button>
|
||||||
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
{% if v.admin_level >= PERMS['MODERATE_PENDING_SUBMITTED_ASSETS'] %}
|
||||||
<button type="button" class="btn btn-success ml-3" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this)" data-name="{{hat.name}}">Approve</button>
|
<button type="button" class="btn btn-success ml-3 mr-1" data-nonce="{{g.nonce}}" data-onclick="approve_hat(this)" data-name="{{hat.name}}">Approve</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
Loading…
Reference in New Issue