feat: add graduation archive and public document services
This commit is contained in:
@@ -6,7 +6,6 @@
|
||||
$isAdmin = auth()->user()?->isAdmin() ?? false;
|
||||
|
||||
$indexRoute = match ($viewMode ?? 'all') {
|
||||
'graduated' => route('students.graduated'),
|
||||
'transferred' => route('students.transferred'),
|
||||
default => route('students.index'),
|
||||
};
|
||||
@@ -28,25 +27,28 @@
|
||||
<div class="flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div></div>
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
@if ($isAdmin)
|
||||
<a href="{{ route('students.import.form') }}" class="inline-flex items-center justify-center rounded-2xl border border-emerald-200 bg-emerald-50 px-5 py-3 text-sm font-semibold text-emerald-700 transition hover:bg-emerald-100">
|
||||
Import Data Siswa
|
||||
@if (($viewMode ?? 'all') === 'all')
|
||||
@if ($isAdmin)
|
||||
<a href="{{ route('students.import.form') }}" class="inline-flex items-center justify-center rounded-2xl border border-emerald-200 bg-emerald-50 px-5 py-3 text-sm font-semibold text-emerald-700 transition hover:bg-emerald-100">
|
||||
Import Data Siswa
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('students.create') }}" class="inline-flex items-center justify-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">
|
||||
Tambah Siswa
|
||||
</a>
|
||||
@endif
|
||||
<a href="{{ route('students.create') }}" class="inline-flex items-center justify-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">
|
||||
Tambah Siswa
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<x-master-card title="Filter Data Siswa" subtitle="Cari berdasarkan nama, NIS, NISN, kontak, atau filter akademik dasar.">
|
||||
<form method="GET" action="{{ $indexRoute }}" class="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-5">
|
||||
<x-form-input name="search" label="Pencarian" :value="$search" placeholder="Nama / NIS / NISN / HP" />
|
||||
<x-form-select name="academic_year_id" label="Tahun Angkatan" :options="$academicYears->all()" :value="$filters['academic_year_id']" />
|
||||
<x-form-select name="department_id" label="Program Keahlian" :options="$departments->all()" :value="$filters['department_id']" />
|
||||
<x-form-select name="class_id" label="Kelas" :options="$classes->all()" :value="$filters['class_id']" />
|
||||
<x-form-select name="status" label="Status" :options="$statuses" :value="$filters['status']" />
|
||||
@if (($viewMode ?? 'all') === 'all')
|
||||
<x-form-select name="status" label="Status" :options="$statuses" :value="$filters['status']" />
|
||||
@endif
|
||||
|
||||
<input type="hidden" name="sort" value="{{ $sort }}">
|
||||
<input type="hidden" name="direction" value="{{ $direction }}">
|
||||
@@ -67,7 +69,7 @@
|
||||
<div><span class="font-semibold text-slate-800">Total data:</span> {{ $students->total() }} siswa</div>
|
||||
<div class="text-xs text-slate-400">Halaman {{ $students->currentPage() }} dari {{ $students->lastPage() }}</div>
|
||||
</div>
|
||||
@if ($isAdmin)
|
||||
@if ($isAdmin && ($viewMode ?? 'all') === 'all')
|
||||
<div class="flex flex-wrap items-center gap-3">
|
||||
<label class="inline-flex items-center gap-2 text-sm text-slate-600">
|
||||
<input type="checkbox" id="select-all-students" class="rounded border-slate-300 text-indigo-600 focus:ring-indigo-500">
|
||||
@@ -89,7 +91,7 @@
|
||||
<table class="min-w-full divide-y divide-slate-200">
|
||||
<thead class="bg-slate-50">
|
||||
<tr>
|
||||
@if ($isAdmin)
|
||||
@if ($isAdmin && ($viewMode ?? 'all') === 'all')
|
||||
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-[0.16em] text-slate-500">Pilih</th>
|
||||
@endif
|
||||
<th class="px-6 py-4 text-left text-xs font-semibold uppercase tracking-[0.16em] text-slate-500">
|
||||
@@ -111,7 +113,7 @@
|
||||
<tbody class="divide-y divide-slate-100 bg-white">
|
||||
@forelse ($students as $student)
|
||||
<tr>
|
||||
@if ($isAdmin)
|
||||
@if ($isAdmin && ($viewMode ?? 'all') === 'all')
|
||||
<td class="px-6 py-4 align-top">
|
||||
<input type="checkbox" name="student_ids[]" value="{{ $student->id }}" class="student-row-checkbox rounded border-slate-300 text-indigo-600 focus:ring-indigo-500">
|
||||
</td>
|
||||
@@ -197,8 +199,10 @@
|
||||
<td class="px-6 py-4">
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<a href="{{ route('students.show', $student) }}" class="rounded-xl border border-sky-200 px-3 py-2 text-xs font-semibold text-sky-700 transition hover:bg-sky-50">Detail</a>
|
||||
<a href="{{ route('students.edit', $student) }}" class="rounded-xl border border-slate-200 px-3 py-2 text-xs font-semibold text-slate-700 transition hover:bg-slate-50">Edit</a>
|
||||
@if ($isAdmin)
|
||||
@if (($viewMode ?? 'all') === 'all')
|
||||
<a href="{{ route('students.edit', $student) }}" class="rounded-xl border border-slate-200 px-3 py-2 text-xs font-semibold text-slate-700 transition hover:bg-slate-50">Edit</a>
|
||||
@endif
|
||||
@if ($isAdmin && ($viewMode ?? 'all') === 'all')
|
||||
<form action="{{ route('students.destroy', $student) }}" method="POST" class="delete-form" data-entity="data siswa {{ $student->full_name }}">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
@@ -210,7 +214,7 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="{{ $isAdmin ? 7 : 6 }}" class="px-6 py-10 text-center text-sm text-slate-500">Belum ada data siswa.</td>
|
||||
<td colspan="{{ ($isAdmin && ($viewMode ?? 'all') === 'all') ? 7 : 6 }}" class="px-6 py-10 text-center text-sm text-slate-500">Belum ada data siswa.</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user