mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-07-01 07:22:17 +02:00
Update: user-management panel
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -58,20 +58,26 @@
|
|||||||
? '<span class="admin-badge admin-badge--blocked">Blocked</span>'
|
? '<span class="admin-badge admin-badge--blocked">Blocked</span>'
|
||||||
: '<span class="admin-badge admin-badge--active">Active</span>';
|
: '<span class="admin-badge admin-badge--active">Active</span>';
|
||||||
|
|
||||||
var blockBtn = blocked
|
var isCurrentUser = u.username === username;
|
||||||
? '<button class="admin-btn admin-btn--unblock" data-id="' +
|
var blockBtn = '';
|
||||||
u.id +
|
var deleteBtn = '';
|
||||||
'" data-action="unblock_user">Unblock</button>'
|
|
||||||
: '<button class="admin-btn admin-btn--block" data-id="' +
|
|
||||||
u.id +
|
|
||||||
'" data-action="block_user">Block</button>';
|
|
||||||
|
|
||||||
var deleteBtn =
|
if (!isCurrentUser) {
|
||||||
'<button class="admin-btn admin-btn--delete" data-id="' +
|
blockBtn = blocked
|
||||||
u.id +
|
? '<button class="admin-btn admin-btn--unblock" data-id="' +
|
||||||
'" data-username="' +
|
u.id +
|
||||||
escHtml(u.username) +
|
'" data-action="unblock_user">Unblock</button>'
|
||||||
'" data-action="delete_user">Delete</button>';
|
: '<button class="admin-btn admin-btn--block" data-id="' +
|
||||||
|
u.id +
|
||||||
|
'" data-action="block_user">Block</button>';
|
||||||
|
|
||||||
|
deleteBtn =
|
||||||
|
'<button class="admin-btn admin-btn--delete" data-id="' +
|
||||||
|
u.id +
|
||||||
|
'" data-username="' +
|
||||||
|
escHtml(u.username) +
|
||||||
|
'" data-action="delete_user">Delete Records</button>';
|
||||||
|
}
|
||||||
|
|
||||||
html +=
|
html +=
|
||||||
'<tr id="user-row-' +
|
'<tr id="user-row-' +
|
||||||
@@ -116,6 +122,13 @@
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
return;
|
return;
|
||||||
|
} else if (action === 'block_user') {
|
||||||
|
if (
|
||||||
|
!confirm(
|
||||||
|
"This will permanently delete the user's email history and cannot be undone"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user