dedup in group_memberships.html

master
Aevann 2023-02-26 02:05:37 +02:00
parent 34cc2a4d82
commit 8503ab39e2
2 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,7 @@
const members_tbody = document.getElementById('Members_tbody')
function approve_membership(t, url, uid) {
function approve_membership(t, group, uid) {
url = `/!${group}/${uid}/approve`
postToast(t, url,
{
},
@ -15,7 +16,8 @@ function approve_membership(t, url, uid) {
);
}
function reject_membership(t, url) {
function reject_membership(t, group, uid) {
url = `/!${group}/${uid}/reject`
postToast(t, url,
{
},

View File

@ -42,12 +42,12 @@
{% if v.id == group.owner.id %}
<td>
<div id="kick-{{membership.user_id}}" {% if name == 'Applications' %}class="d-none"{% endif %}>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'/!{{group}}/{{membership.user_id}}/reject')">Kick</button>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'{{group}}','{{membership.user_id}}')">Kick</button>
</div>
<div {% if name == 'Members' %}class="d-none"{% endif %}>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="approve_membership(this,'/!{{group}}/{{membership.user_id}}/approve','{{membership.user_id}}')">Approve</button>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'/!{{group}}/{{membership.user_id}}/reject','{{membership.user_id}}')">Reject</button>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="approve_membership(this,'{{group}}','{{membership.user_id}}')">Approve</button>
<button type="button" class="btn btn-primary btn-block" data-nonce="{{g.nonce}}" data-onclick="reject_membership(this,'{{group}}','{{membership.user_id}}')">Reject</button>
</div>
</td>
{% endif %}