Initial commit
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
<x-master-page title="Manajemen Pengguna" description="Kelola akun administrator dan staff yang dapat mengakses panel Database Kesiswaan." action-label="Tambah Pengguna" :action-url="route('settings.users.create')">
|
||||
<x-master-card title="Daftar Pengguna" subtitle="Gunakan halaman ini untuk menambah, mengubah, dan menghapus akun admin internal.">
|
||||
<form method="GET" class="mb-5">
|
||||
<div class="grid grid-cols-1 gap-3 md:grid-cols-[1fr_auto]">
|
||||
<x-form-input name="search" label="Cari Pengguna" :value="$search" placeholder="Cari nama atau email..." />
|
||||
<div class="flex items-end">
|
||||
<button type="submit" class="inline-flex h-12 items-center justify-center rounded-2xl bg-indigo-600 px-5 text-sm font-semibold text-white shadow-lg shadow-indigo-200 transition hover:bg-indigo-700">Cari</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<div class="overflow-x-auto">
|
||||
<table class="min-w-full divide-y divide-slate-200 text-sm">
|
||||
<thead class="bg-slate-50">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-600">Nama</th>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-600">Email</th>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-600">Role</th>
|
||||
<th class="px-4 py-3 text-left font-semibold text-slate-600">Status</th>
|
||||
<th class="px-4 py-3 text-right font-semibold text-slate-600">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-slate-100 bg-white">
|
||||
@forelse ($users as $user)
|
||||
<tr>
|
||||
<td class="px-4 py-4 font-medium text-slate-800">{{ $user->name }}</td>
|
||||
<td class="px-4 py-4 text-slate-600">{{ $user->email }}</td>
|
||||
<td class="px-4 py-4">
|
||||
<span class="rounded-full px-3 py-1 text-xs font-semibold {{ $user->role === 'admin' ? 'bg-indigo-100 text-indigo-700' : 'bg-slate-100 text-slate-700' }}">
|
||||
{{ $roleOptions[$user->role] ?? ucfirst($user->role) }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-4 text-slate-500">{{ auth()->id() === $user->id ? 'Sedang dipakai login' : 'Aktif' }}</td>
|
||||
<td class="px-4 py-4">
|
||||
<div class="flex justify-end gap-2">
|
||||
<a href="{{ route('settings.users.edit', $user) }}" class="inline-flex items-center rounded-xl border border-slate-200 px-3 py-2 text-xs font-semibold text-slate-700 transition hover:bg-slate-50">Edit</a>
|
||||
<form method="POST" action="{{ route('settings.users.destroy', $user) }}" onsubmit="return confirm('Hapus akun ini?')">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="inline-flex items-center rounded-xl border border-rose-200 px-3 py-2 text-xs font-semibold text-rose-600 transition hover:bg-rose-50">Hapus</button>
|
||||
</form>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="5" class="px-4 py-8 text-center text-slate-500">Belum ada data pengguna.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="mt-5">
|
||||
{{ $users->links() }}
|
||||
</div>
|
||||
</x-master-card>
|
||||
</x-master-page>
|
||||
Reference in New Issue
Block a user