forked from rDrama/rDrama
better js for approving apps
parent
701da59c69
commit
d0f3dcf765
|
@ -6,3 +6,14 @@ function remove_app(t, url) {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
function approve_app(t, url) {
|
||||
postToast(t, url,
|
||||
{},
|
||||
() => {
|
||||
t.nextElementSibling.classList.remove('d-none')
|
||||
t.previousElementSibling.remove()
|
||||
t.remove()
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -33,10 +33,9 @@
|
|||
<div class="d-flex">
|
||||
{% if not app.client_id %}
|
||||
<button type="button" class="btn btn-secondary ml-auto mr-2" data-nonce="{{g.nonce}}" data-onclick="remove_app(this,'/admin/app/reject/{{app.id}}')">Reject</button>
|
||||
<button type="button" class="btn btn-primary mr-0" data-nonce="{{g.nonce}}" data-onclick="remove_app(this,'/admin/app/approve/{{app.id}}')">Approve</button>
|
||||
{% else %}
|
||||
<button type="button" class="btn btn-primary ml-auto" data-nonce="{{g.nonce}}" data-onclick="remove_app(this,'/admin/app/revoke/{{app.id}}')">Revoke</button>
|
||||
<button type="button" class="btn btn-primary mr-0" data-nonce="{{g.nonce}}" data-onclick="approve_app(this,'/admin/app/approve/{{app.id}}')">Approve</button>
|
||||
{% endif %}
|
||||
<button type="button" class="btn btn-primary ml-auto {% if not app.client_id %}d-none{% endif %}" data-nonce="{{g.nonce}}" data-onclick="remove_app(this,'/admin/app/revoke/{{app.id}}')">Revoke</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue