mirror of
https://github.com/hyzendust/hyzendust.github.io.git
synced 2026-06-30 23:12:16 +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--active">Active</span>';
|
||||
|
||||
var blockBtn = blocked
|
||||
? '<button class="admin-btn admin-btn--unblock" data-id="' +
|
||||
u.id +
|
||||
'" data-action="unblock_user">Unblock</button>'
|
||||
: '<button class="admin-btn admin-btn--block" data-id="' +
|
||||
u.id +
|
||||
'" data-action="block_user">Block</button>';
|
||||
var isCurrentUser = u.username === username;
|
||||
var blockBtn = '';
|
||||
var deleteBtn = '';
|
||||
|
||||
var deleteBtn =
|
||||
'<button class="admin-btn admin-btn--delete" data-id="' +
|
||||
u.id +
|
||||
'" data-username="' +
|
||||
escHtml(u.username) +
|
||||
'" data-action="delete_user">Delete</button>';
|
||||
if (!isCurrentUser) {
|
||||
blockBtn = blocked
|
||||
? '<button class="admin-btn admin-btn--unblock" data-id="' +
|
||||
u.id +
|
||||
'" data-action="unblock_user">Unblock</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 +=
|
||||
'<tr id="user-row-' +
|
||||
@@ -116,6 +122,13 @@
|
||||
)
|
||||
)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user