forked from rDrama/rDrama
fix approving/removing hats with `(` in name
parent
89e0d49b38
commit
13e83143fd
|
@ -1,6 +1,5 @@
|
||||||
function approve_hat(t, name) {
|
function approve_hat(t) {
|
||||||
console.log(name)
|
const name = t.dataset.name
|
||||||
console.log(`${name}-description`)
|
|
||||||
postToast(t, `/admin/approve/hat/${name}`,
|
postToast(t, `/admin/approve/hat/${name}`,
|
||||||
{
|
{
|
||||||
"description": document.getElementById(`${name}-description`).value,
|
"description": document.getElementById(`${name}-description`).value,
|
||||||
|
@ -13,7 +12,8 @@ function approve_hat(t, name) {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function remove_hat(t, name) {
|
function remove_hat(t) {
|
||||||
|
const name = t.dataset.name
|
||||||
postToast(t, `/remove/hat/${name}`,
|
postToast(t, `/remove/hat/${name}`,
|
||||||
{
|
{
|
||||||
},
|
},
|
||||||
|
|
|
@ -82,9 +82,9 @@
|
||||||
</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">
|
||||||
<button type="button" class="btn btn-danger ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_hat(this, '{{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, '{{hat.name}}')">Approve</button>
|
<button type="button" class="btn btn-success ml-3" 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