Initial commit
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2">
|
||||
<x-form-input name="name" label="Nama Lengkap" :value="$user->name ?? ''" required />
|
||||
<x-form-input name="email" label="Email" type="email" :value="$user->email ?? ''" required />
|
||||
<x-form-select name="role" label="Role" :options="$roleOptions" :value="$user->role ?? 'staff'" placeholder="-- Pilih role --" required />
|
||||
|
||||
<div class="rounded-3xl border border-slate-200 bg-slate-50 p-5 md:col-span-2">
|
||||
<div class="grid grid-cols-1 gap-5 md:grid-cols-2">
|
||||
<x-form-input name="password" label="Password {{ isset($user) ? '(opsional jika tidak diubah)' : '' }}" type="password" />
|
||||
<x-form-input name="password_confirmation" label="Konfirmasi Password" type="password" />
|
||||
</div>
|
||||
<p class="mt-3 text-xs text-slate-500">Password minimal 8 karakter.</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -0,0 +1,14 @@
|
||||
<x-master-page title="Tambah Pengguna" description="Buat akun administrator atau staff baru untuk panel Database Kesiswaan.">
|
||||
<form method="POST" action="{{ route('settings.users.store') }}" class="space-y-6">
|
||||
@csrf
|
||||
|
||||
<x-master-card title="Form Pengguna" subtitle="Isi data akun dengan lengkap sebelum disimpan.">
|
||||
@include('users._form')
|
||||
</x-master-card>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('settings.users.index') }}" class="inline-flex items-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-semibold text-slate-700 transition hover:bg-slate-50">Batal</a>
|
||||
<button type="submit" class="inline-flex items-center rounded-2xl bg-indigo-600 px-5 py-3 text-sm font-semibold text-white shadow-lg shadow-indigo-200 transition hover:bg-indigo-700">Simpan Pengguna</button>
|
||||
</div>
|
||||
</form>
|
||||
</x-master-page>
|
||||
@@ -0,0 +1,15 @@
|
||||
<x-master-page title="Edit Pengguna" description="Perbarui data akun administrator atau staff.">
|
||||
<form method="POST" action="{{ route('settings.users.update', $user) }}" class="space-y-6">
|
||||
@csrf
|
||||
@method('PUT')
|
||||
|
||||
<x-master-card title="Form Pengguna" subtitle="Kosongkan password jika tidak ingin mengubah password akun ini.">
|
||||
@include('users._form')
|
||||
</x-master-card>
|
||||
|
||||
<div class="flex justify-end gap-3">
|
||||
<a href="{{ route('settings.users.index') }}" class="inline-flex items-center rounded-2xl border border-slate-200 bg-white px-5 py-3 text-sm font-semibold text-slate-700 transition hover:bg-slate-50">Batal</a>
|
||||
<button type="submit" class="inline-flex items-center rounded-2xl bg-indigo-600 px-5 py-3 text-sm font-semibold text-white shadow-lg shadow-indigo-200 transition hover:bg-indigo-700">Update Pengguna</button>
|
||||
</div>
|
||||
</form>
|
||||
</x-master-page>
|
||||
@@ -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