diff --git a/docs/admin/index.html b/docs/admin/index.html index 17b76ba..935e08f 100644 --- a/docs/admin/index.html +++ b/docs/admin/index.html @@ -9,4 +9,4 @@ All updates
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/css/custom.css b/docs/css/custom.css index 313e046..4b0846d 100644 --- a/docs/css/custom.css +++ b/docs/css/custom.css @@ -1401,10 +1401,6 @@ background: #d4edda; color: #155724; } -.admin-badge--admin { - background: #dbeafe; - color: #1e3a8a; -} .admin-badge--blocked { background: #f8d7da; color: #721c24; diff --git a/layouts/admin/single.html b/layouts/admin/single.html index 8eab20b..b85721c 100644 --- a/layouts/admin/single.html +++ b/layouts/admin/single.html @@ -57,47 +57,31 @@ return; } - var adminIndex = users.findIndex(function (u) { - return u.username === username; - }); - var adminUser = adminIndex === -1 ? null : users[adminIndex]; - var otherUsers = users.filter(function (u) { - return u.username !== username; - }); var html = '' + '' + - '' + - (adminUser ? '' : '') + + '' + ''; - function userRow(u, isCurrentUser) { + function userRow(u) { var joined = new Date(u.created_at).toLocaleDateString(); var blocked = u.blocked === true || u.blocked === 't' || u.blocked === '1'; - var status = isCurrentUser - ? 'Admin' - : blocked - ? 'Blocked' - : 'Active'; - var blockBtn = ''; - var deleteBtn = ''; - - if (!isCurrentUser) { - blockBtn = blocked - ? '' - : ''; - - deleteBtn = - '' + : ''; + var deleteBtn = + ''; - } return ( '' + blockBtn + ' ' + deleteBtn + '') + + '' + '' ); } - if (adminUser) { - html += userRow(adminUser, true); - } - otherUsers.forEach(function (u) { - html += userRow(u, false); + users.forEach(function (u) { + html += userRow(u); }); html += '
#UsernameEmailJoinedStatusActionsActions#UsernameEmailJoinedStatusActions
' + + blockBtn + + ' ' + + deleteBtn + + '
'; @@ -220,9 +203,10 @@ var query = search.value.trim().toLowerCase(); var users = allUsers.filter(function (u) { return ( - !query || - String(u.username).toLowerCase().includes(query) || - String(u.email).toLowerCase().includes(query) + u.username !== username && + (!query || + String(u.username).toLowerCase().includes(query) || + String(u.email).toLowerCase().includes(query)) ); }); renderTable(users); diff --git a/static/css/custom.css b/static/css/custom.css index 313e046..4b0846d 100644 --- a/static/css/custom.css +++ b/static/css/custom.css @@ -1401,10 +1401,6 @@ background: #d4edda; color: #155724; } -.admin-badge--admin { - background: #dbeafe; - color: #1e3a8a; -} .admin-badge--blocked { background: #f8d7da; color: #721c24;