From 61b93a35acdd28a99a13ba21ab7c0f11f9ded62c Mon Sep 17 00:00:00 2001 From: Novy San87 Date: Fri, 7 Aug 2026 10:47:40 +0700 Subject: [PATCH] =?UTF-8?q?ui(premium):=20modal=20Tolak=20Wali=20custom=20?= =?UTF-8?q?(Alpine)=20=E2=80=94=20header=20ikon=20gradien=20rose,=20kartu?= =?UTF-8?q?=20info,=20textarea=20alasan=20+=20counter=200/255,=20tombol=20?= =?UTF-8?q?loading=20state;=20ganti=20SweetAlert=20polos?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../views/parents/verification.blade.php | 114 +++++++++++++++--- 1 file changed, 95 insertions(+), 19 deletions(-) diff --git a/resources/views/parents/verification.blade.php b/resources/views/parents/verification.blade.php index d13cb7f..c46ebbb 100644 --- a/resources/views/parents/verification.blade.php +++ b/resources/views/parents/verification.blade.php @@ -3,7 +3,7 @@ @section('title', 'Verifikasi Wali Murid') @section('content') -
+
{{-- Header premium --}}
@@ -188,7 +188,7 @@ class="inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-gradient-to-r from-emerald-500 to-teal-600 text-white text-sm font-bold shadow-md shadow-emerald-500/30 hover:shadow-lg hover:-translate-y-0.5 hover:brightness-105 transition-all"> Setujui - @@ -259,6 +259,73 @@
@endif + {{-- Modal Tolak (premium) --}} + +
@push('scripts') @@ -288,32 +355,41 @@ function approveWali(linkId, userName, studentName) { }); } -function rejectWali(linkId, userName) { - Swal.fire({ - title: 'Tolak akun ' + userName + '?', - html: '', - icon: 'warning', - confirmButtonText: ' Ya, Tolak', - showCancelButton: true, - cancelButtonText: 'Batal', - confirmButtonColor: '#e11d48', - }).then((result) => { - if (result.isConfirmed) { - const reason = document.getElementById('reject-reason') ? document.getElementById('reject-reason').value : ''; - fetch('{{ url('parents/verification') }}/' + linkId + '/reject', { +function rejectModal() { + return { + show: false, + loading: false, + id: null, + name: '', + reason: '', + openReject(linkId, userName) { + this.id = linkId; + this.name = userName; + this.reason = ''; + this.show = true; + }, + confirmReject() { + if (this.loading) return; + this.loading = true; + fetch('{{ url('parents/verification') }}/' + this.id + '/reject', { method: 'POST', headers: { 'Content-Type': 'application/json', 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').content, 'Accept': 'application/json', }, - body: JSON.stringify({ reason: reason }), - }).then(r => { + body: JSON.stringify({ reason: this.reason }), + }) + .then(r => { if (r.redirected) window.location.href = r.url; else location.reload(); + }) + .catch(() => { + this.loading = false; + this.show = false; }); - } - }); + }, + }; } @endpush