Files
2026-09-02 17:08:57 +00:00

95 lines
4.3 KiB
PHP
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<x-layouts::app :title="__('Users')">
<div class="hd-page-shell space-y-5">
<section class="hd-page-hero">
<div>
<div class="hd-eyebrow">Administration</div>
<h1>Users</h1>
<p>Manage Helpdesk users, administrators and agents.</p>
</div>
<a href="{{ route('user-management.create') }}" class="hd-action hd-action-green">
<i class="fa-solid fa-user-plus"></i> New user
</a>
</section>
@if (session('status'))
<div class="hd-alert hd-alert-success">{{ session('status') }}</div>
@endif
<section class="hd-panel">
<form method="GET" class="hd-toolbar">
<div class="hd-search-field">
<i class="fa-solid fa-magnifying-glass"></i>
<input name="search" value="{{ $search }}" placeholder="Search users by name or email">
</div>
<button class="hd-action hd-action-blue" type="submit">Search</button>
</form>
<div class="hd-table-wrap">
<table class="hd-table">
<thead><tr><th>User</th><th>Email</th><th>Role</th><th>Verified</th><th class="text-right">Actions</th></tr></thead>
<tbody>
@forelse($users as $user)
<tr>
<td>
<div class="flex items-center gap-3">
<span class="hd-user-avatar">{{ $user->initials() }}</span>
<span class="font-semibold">{{ $user->name }}</span>
</div>
</td>
<td>{{ $user->email }}</td>
<td>
@if($user->helpdesk_admin)
<span class="hd-role-pill hd-role-admin">Administrator</span>
@elseif($user->helpdesk_agent)
<span class="hd-role-pill hd-role-agent">Agent</span>
@else
<span class="hd-role-pill">User</span>
@endif
</td>
<td>{{ $user->email_verified_at ? 'Yes' : 'No' }}</td>
<td class="text-right"><a class="hd-action hd-action-blue hd-action-sm" href="{{ route('user-management.edit', $user) }}">Edit</a></td>
</tr>
@empty
<tr><td colspan="5" class="text-center text-zinc-500">No users found.</td></tr>
@endforelse
</tbody>
</table>
</div>
<div class="flex flex-col gap-3 border-t border-zinc-800 px-6 py-4 sm:flex-row sm:items-center sm:justify-between">
<div class="text-sm text-zinc-500">
Showing
<span class="font-semibold text-zinc-300">{{ $users->firstItem() ?? 0 }}</span>
–
<span class="font-semibold text-zinc-300">{{ $users->lastItem() ?? 0 }}</span>
of
<span class="font-semibold text-zinc-300">{{ $users->total() }}</span>
</div>
<div class="flex items-center gap-2">
@if ($users->onFirstPage())
<span class="rounded-lg border border-zinc-800 px-3 py-2 text-sm text-zinc-600">Previous</span>
@else
<a href="{{ $users->previousPageUrl() }}" class="rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm font-medium text-zinc-200 hover:border-blue-500 hover:text-white">
Previous
</a>
@endif
<span class="rounded-lg bg-blue-600/15 px-3 py-2 text-sm font-semibold text-blue-300">
Page {{ $users->currentPage() }} of {{ max(1, $users->lastPage()) }}
</span>
@if ($users->hasMorePages())
<a href="{{ $users->nextPageUrl() }}" class="rounded-lg border border-zinc-700 bg-zinc-900 px-3 py-2 text-sm font-medium text-zinc-200 hover:border-blue-500 hover:text-white">
Next
</a>
@else
<span class="rounded-lg border border-zinc-800 px-3 py-2 text-sm text-zinc-600">Next</span>
@endif
</div>
</div>
</section>
</div>
</x-layouts::app>