From 0a5f471854345dff912f9e9f3b5f0e04f8d55ca9 Mon Sep 17 00:00:00 2001 From: Novy San87 Date: Tue, 28 Jul 2026 12:37:43 +0700 Subject: [PATCH] fix: default presensi 'belum', perbesar tombol rekap & bulk H/S/I/A/T MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Default status per jam dari 'hadir' jadi 'belum' (abu-abu '—') - Tambah validasi skip 'belum' saat simpan - Tombol bulk H/S/I/A/T diperbesar (w-8 h-8, border-2) - Tombol Rekap Presensi diubah ke gradien violet-indigo - Gradien tombol Lanjutkan & Simpan konsisten --- app/Http/Controllers/AttendanceController.php | 3 ++ resources/views/attendances/create.blade.php | 30 +++++++++++-------- 2 files changed, 21 insertions(+), 12 deletions(-) diff --git a/app/Http/Controllers/AttendanceController.php b/app/Http/Controllers/AttendanceController.php index 57fbee0..8383ee4 100644 --- a/app/Http/Controllers/AttendanceController.php +++ b/app/Http/Controllers/AttendanceController.php @@ -153,6 +153,9 @@ class AttendanceController extends Controller if (!isset($data['student_id'], $data['lesson_hour'], $data['status'])) { continue; } + if ($data['status'] === 'belum') { + continue; + } $data['lesson_hour'] = (int) $data['lesson_hour']; Attendance::updateOrCreate( [ diff --git a/resources/views/attendances/create.blade.php b/resources/views/attendances/create.blade.php index d09dfcd..edeaed9 100644 --- a/resources/views/attendances/create.blade.php +++ b/resources/views/attendances/create.blade.php @@ -52,7 +52,7 @@
@@ -101,8 +101,8 @@
- Rekap + class="inline-flex items-center gap-2 px-4 py-2 text-sm font-bold text-white bg-gradient-to-r from-violet-600 to-indigo-600 rounded-xl hover:from-violet-700 hover:to-indigo-700 active:scale-[0.97] transition-all duration-200 shadow-md hover:shadow-lg"> + Rekap Presensi
@@ -150,17 +150,17 @@ {{-- Per-row bulk buttons --}} -
+
+ class="w-8 h-8 rounded-lg text-xs font-bold bg-emerald-100 text-emerald-700 border-2 border-emerald-300 hover:bg-emerald-200 hover:scale-110 active:scale-95 transition-all duration-150 shadow-sm">H + class="w-8 h-8 rounded-lg text-xs font-bold bg-purple-100 text-purple-700 border-2 border-purple-300 hover:bg-purple-200 hover:scale-110 active:scale-95 transition-all duration-150 shadow-sm">S + class="w-8 h-8 rounded-lg text-xs font-bold bg-blue-100 text-blue-700 border-2 border-blue-300 hover:bg-blue-200 hover:scale-110 active:scale-95 transition-all duration-150 shadow-sm">I + class="w-8 h-8 rounded-lg text-xs font-bold bg-red-100 text-red-700 border-2 border-red-300 hover:bg-red-200 hover:scale-110 active:scale-95 transition-all duration-150 shadow-sm">A + class="w-8 h-8 rounded-lg text-xs font-bold bg-yellow-100 text-yellow-700 border-2 border-yellow-300 hover:bg-yellow-200 hover:scale-110 active:scale-95 transition-all duration-150 shadow-sm">T
@@ -168,8 +168,9 @@ @foreach($lessonHours as $lh) @php $key = $s->id . '-' . $lh; - $currentStatus = isset($existing[$key]) ? $existing[$key]->status : 'hadir'; + $currentStatus = isset($existing[$key]) ? $existing[$key]->status : 'belum'; $statusColors = [ + 'belum' => 'bg-gray-100 border-gray-300 text-gray-400 hover:bg-gray-200', 'hadir' => 'bg-emerald-100 border-emerald-300 text-emerald-700 hover:bg-emerald-200', 'sakit' => 'bg-purple-100 border-purple-300 text-purple-700 hover:bg-purple-200', 'izin' => 'bg-blue-100 border-blue-300 text-blue-700 hover:bg-blue-200', @@ -177,10 +178,12 @@ 'terlambat' => 'bg-yellow-100 border-yellow-300 text-yellow-700 hover:bg-yellow-200', ]; $statusLabels = [ + 'belum' => '—', 'hadir' => 'H', 'sakit' => 'S', 'izin' => 'I', 'alpha' => 'A', 'terlambat' => 'T', ]; $statusFull = [ + 'belum' => 'Belum diisi', 'hadir' => 'Hadir', 'sakit' => 'Sakit', 'izin' => 'Izin', 'alpha' => 'Alpha', 'terlambat' => 'Terlambat', ]; @@ -237,7 +240,7 @@ Klik untuk ganti status
@@ -260,8 +263,9 @@ @push('scripts')