fix(ui): apply code review feedback on admin_users template accessibility
Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</div>
|
||||
|
||||
<!-- ── Alert banner ───────────────────────────────────────────────────────── -->
|
||||
<div x-show="alert.show" x-transition class="mb-4" role="alert" aria-live="polite">
|
||||
<div x-show="alert.show" x-transition class="mb-4" role="alert" :aria-live="alert.type === 'error' ? 'assertive' : 'polite'">
|
||||
<div
|
||||
:class="alert.type === 'success'
|
||||
? 'bg-green-50 border-green-400 text-green-800'
|
||||
@@ -108,7 +108,7 @@
|
||||
<a
|
||||
:href="`/files?owner_id=${encodeURIComponent(user.user_id)}`"
|
||||
class="inline-flex items-center gap-1 text-blue-600 hover:underline font-medium"
|
||||
:title="`View documents for ${user.user_id}`"
|
||||
:aria-label="`View ${user.document_count} document${user.document_count !== 1 ? 's' : ''} for ${user.user_id}`"
|
||||
>
|
||||
<i class="fas fa-file text-xs" aria-hidden="true"></i>
|
||||
<span x-text="user.document_count"></span>
|
||||
@@ -284,7 +284,14 @@
|
||||
<!-- Blocked toggle -->
|
||||
<div class="flex items-center gap-3">
|
||||
<label class="relative inline-flex items-center cursor-pointer">
|
||||
<input type="checkbox" x-model="form.is_blocked" class="sr-only peer" id="modal-blocked" />
|
||||
<input
|
||||
type="checkbox"
|
||||
x-model="form.is_blocked"
|
||||
class="sr-only peer"
|
||||
id="modal-blocked"
|
||||
role="switch"
|
||||
:aria-checked="form.is_blocked"
|
||||
/>
|
||||
<div class="w-10 h-6 bg-gray-200 peer-focus:ring-2 peer-focus:ring-blue-400 rounded-full peer peer-checked:bg-red-500 after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:after:translate-x-4"></div>
|
||||
</label>
|
||||
<label for="modal-blocked" class="text-sm font-medium text-gray-700">
|
||||
@@ -527,7 +534,7 @@ function adminUsersApp() {
|
||||
userInitials(userId) {
|
||||
if (!userId) return '?';
|
||||
// Try to get initials from email or username
|
||||
const parts = userId.split(/[@._\-\s]+/);
|
||||
const parts = userId.split(/[@._\s-]+/);
|
||||
return parts.slice(0, 2).map(p => p[0]?.toUpperCase() || '').join('') || userId[0].toUpperCase();
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user