Update: user-management panel

This commit is contained in:
hyzen
2026-06-13 11:48:12 +05:30
parent 6b93a6b3bf
commit e79fa2eb5f
2 changed files with 27 additions and 14 deletions

File diff suppressed because one or more lines are too long

View File

@@ -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;