From 87cfaa1dcd936f6a7a18df33d0d4cf38b782c807 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Thu, 9 Jul 2026 16:09:47 +0700 Subject: [PATCH 1/2] update gitignore --- .gitignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 4126c5c2d..ececb89ee 100644 --- a/.gitignore +++ b/.gitignore @@ -30,7 +30,9 @@ public/error_log /.vscode # Themes -# /themes/* +/themes/* +!/themes/opendk/ +/themes/opendk/* !/themes/opendk/default/ /storage/komplain From 5883106648f1379d02258cd058d3f1efd9104f72 Mon Sep 17 00:00:00 2001 From: Ahmad Afandi Date: Fri, 10 Jul 2026 15:47:49 +0700 Subject: [PATCH 2/2] gunakan modal bootstrap sebagai pengganti alert dan confirm bawaan browser --- public/js/admin.js | 8 +--- public/js/modal-helper.js | 45 +++++++++++++++++++ .../auth/2fa/verify-activation.blade.php | 8 ++-- .../views/auth/2fa/verify-login.blade.php | 6 +-- .../auth/otp/verify-activation.blade.php | 6 +-- .../views/auth/otp/verify-login.blade.php | 6 +-- .../auth/otp2fa/verify-settings.blade.php | 6 +-- .../views/components/modal-alert.blade.php | 14 ++++++ .../views/components/modal-confirm.blade.php | 15 +++++++ .../data_sarana/partials/action.blade.php | 2 +- .../views/data/pengurus/create.blade.php | 2 +- resources/views/data/pengurus/edit.blade.php | 2 +- .../data/pengurus/form_create_arsip.blade.php | 2 +- .../data/pengurus/form_edit_arsip.blade.php | 2 +- .../views/informasi/artikel/_form.blade.php | 2 +- .../informasi/media_sosial/create.blade.php | 2 +- .../informasi/media_sosial/edit.blade.php | 2 +- .../views/informasi/prosedur/create.blade.php | 2 +- .../views/informasi/prosedur/edit.blade.php | 2 +- .../informasi/regulasi/form_create.blade.php | 2 +- .../informasi/regulasi/form_update.blade.php | 2 +- .../sinergi_program/create.blade.php | 2 +- .../informasi/sinergi_program/edit.blade.php | 2 +- resources/views/layouts/app.blade.php | 21 +++------ .../layouts/dashboard_template.blade.php | 3 ++ .../views/partials/asset_leaflet.blade.php | 4 +- resources/views/pesan/keluar/index.blade.php | 8 ++-- resources/views/pesan/masuk/index.blade.php | 16 +++---- resources/views/pesan/read_pesan.blade.php | 7 ++- .../views/publikasi/album/_form.blade.php | 2 +- .../views/publikasi/galeri/_form.blade.php | 2 +- .../table-backup.blade.php | 8 ++-- resources/views/setting/slide/form.blade.php | 2 +- resources/views/user/form.blade.php | 2 +- .../vendor/laravel-log-viewer/log.blade.php | 16 +++++-- .../laravel-log-viewer/smtp/index.blade.php | 6 +-- .../views/pages/komplain/jawabans.blade.php | 2 +- .../views/pages/unduhan/prosedur.blade.php | 2 +- .../views/pages/unduhan/regulasi.blade.php | 2 +- 39 files changed, 156 insertions(+), 89 deletions(-) create mode 100644 public/js/modal-helper.js create mode 100644 resources/views/components/modal-alert.blade.php create mode 100644 resources/views/components/modal-confirm.blade.php diff --git a/public/js/admin.js b/public/js/admin.js index 31480f353..445a5c445 100644 --- a/public/js/admin.js +++ b/public/js/admin.js @@ -11,13 +11,7 @@ function errorValidation(response) { var errors = response.responseJSON?.errors; if (!errors) { - Swal.fire({ - title: 'Gagal!', - text: response, - icon: 'error', - confirmButtonText: 'OK', - timer: 1500 - }); + openAlert(response, 'Gagal!', 'danger'); } else { $.each(errors, function(key, value) { $('#' + key) diff --git a/public/js/modal-helper.js b/public/js/modal-helper.js new file mode 100644 index 000000000..8ef1a02d4 --- /dev/null +++ b/public/js/modal-helper.js @@ -0,0 +1,45 @@ +var confirmCallback = null; + +function openAlert(message, title, type) { + var modal = $('#modal-alert'); + modal.find('.modal-title').text(title || 'Pesan'); + modal.find('.modal-body').html(message || ''); + modal.find('.modal-content').removeClass('modal-danger modal-success modal-warning modal-info'); + if (type) { + modal.find('.modal-content').addClass('modal-' + type); + } + modal.modal('show'); +} + +function openConfirm(message, title, callback, btnYesText) { + var modal = $('#modal-confirm'); + modal.find('.modal-title').text(title || 'Konfirmasi'); + modal.find('.modal-body').html(message || ''); + confirmCallback = callback; + modal.find('#modal-confirm-yes').text(btnYesText || 'Ya'); + modal.modal('show'); +} + +$(document).on('click', '#modal-confirm-yes', function () { + $('#modal-confirm').modal('hide'); + if (typeof confirmCallback === 'function') { + confirmCallback(); + } +}); + +$(document).on('click', '[data-confirm]', function (e) { + e.preventDefault(); + var btn = $(this); + var message = btn.data('confirm'); + var title = btn.data('confirm-title') || 'Konfirmasi'; + var btnText = btn.data('confirm-btn') || 'Ya'; + var form = btn.closest('form'); + var href = btn.attr('href'); + openConfirm(message, title, function () { + if (form.length) { + form[0].submit(); + } else if (href) { + window.location.href = href; + } + }, btnText); +}); diff --git a/resources/views/auth/2fa/verify-activation.blade.php b/resources/views/auth/2fa/verify-activation.blade.php index ef9c210f4..3cd2c084c 100644 --- a/resources/views/auth/2fa/verify-activation.blade.php +++ b/resources/views/auth/2fa/verify-activation.blade.php @@ -189,7 +189,7 @@ function updateOtpValue() { if (expirySeconds <= 0) { clearInterval(expiryInterval); clearInterval(resendInterval); - alert('Kode OTP telah kadaluarsa. Silakan minta kode baru.'); + openAlert('Kode OTP telah kadaluarsa. Silakan minta kode baru.', 'Info'); window.location.href = '{{ route('otp2fa.index') }}'; } }, 1000); @@ -222,12 +222,12 @@ function updateOtpValue() { } }, 1000); - alert('Kode OTP baru telah dikirim.'); + openAlert('Kode OTP baru telah dikirim.', 'Info', 'success'); } else { - alert(response.message || 'Gagal mengirim ulang kode OTP.'); + openAlert(response.message || 'Gagal mengirim ulang kode OTP.', 'Info', 'warning'); } }).fail(function() { - alert('Gagal mengirim ulang kode OTP.'); + openAlert('Gagal mengirim ulang kode OTP.', 'Error', 'danger'); }); }); }); diff --git a/resources/views/auth/2fa/verify-login.blade.php b/resources/views/auth/2fa/verify-login.blade.php index 022c7290b..1d925e774 100644 --- a/resources/views/auth/2fa/verify-login.blade.php +++ b/resources/views/auth/2fa/verify-login.blade.php @@ -237,7 +237,7 @@ function updateOtpValue() { if (expirySeconds <= 0) { clearInterval(expiryInterval); clearInterval(resendInterval); - alert('Kode 2FA telah kadaluarsa. Silakan minta kode baru.'); + openAlert('Kode 2FA telah kadaluarsa. Silakan minta kode baru.', 'Info'); window.location.href = '{{ route('login') }}'; } }, 1000); @@ -256,7 +256,7 @@ function updateOtpValue() { purpose: '2fa_login' }, success: function(response) { - alert(response.message); + openAlert(response.message, 'Info', 'success'); // Reset expiry timer expirySeconds = expiryMinutes * 60; @@ -282,7 +282,7 @@ function updateOtpValue() { }, 1000); }, error: function(xhr) { - alert('Gagal mengirim ulang kode 2FA'); + openAlert('Gagal mengirim ulang kode 2FA', 'Error', 'danger'); $('#resend-btn').prop('disabled', false).html( ' Kirim Ulang'); } diff --git a/resources/views/auth/otp/verify-activation.blade.php b/resources/views/auth/otp/verify-activation.blade.php index 62543f628..0b24ae812 100644 --- a/resources/views/auth/otp/verify-activation.blade.php +++ b/resources/views/auth/otp/verify-activation.blade.php @@ -190,7 +190,7 @@ function updateOtpValue() { if (expirySeconds <= 0) { clearInterval(expiryInterval); clearInterval(resendInterval); - alert('Kode OTP telah kadaluarsa. Silakan minta kode baru.'); + openAlert('Kode OTP telah kadaluarsa. Silakan minta kode baru.', 'Info'); window.location.href = '{{ route('otp2fa.index') }}'; } }, 1000); @@ -209,7 +209,7 @@ function updateOtpValue() { purpose: 'activation' }, success: function(response) { - alert(response.message); + openAlert(response.message, 'Info', 'success'); // Reset timer expirySeconds = expiryMinutes * 60; @@ -235,7 +235,7 @@ function updateOtpValue() { }, 1000); }, error: function(xhr) { - alert('Gagal mengirim ulang kode OTP'); + openAlert('Gagal mengirim ulang kode OTP', 'Error', 'danger'); $('#resend-btn').prop('disabled', false).html( ' Kirim Ulang'); } diff --git a/resources/views/auth/otp/verify-login.blade.php b/resources/views/auth/otp/verify-login.blade.php index 692fb4b4b..901690364 100644 --- a/resources/views/auth/otp/verify-login.blade.php +++ b/resources/views/auth/otp/verify-login.blade.php @@ -237,7 +237,7 @@ function updateOtpValue() { if (expirySeconds <= 0) { clearInterval(expiryInterval); clearInterval(resendInterval); - alert('Kode OTP telah kadaluarsa. Silakan minta kode baru.'); + openAlert('Kode OTP telah kadaluarsa. Silakan minta kode baru.', 'Info'); window.location.href = '{{ route('otp.login') }}'; } }, 1000); @@ -256,7 +256,7 @@ function updateOtpValue() { purpose: 'login' }, success: function(response) { - alert(response.message); + openAlert(response.message, 'Info', 'success'); // Reset expiry timer expirySeconds = expiryMinutes * 60; @@ -282,7 +282,7 @@ function updateOtpValue() { }, 1000); }, error: function(xhr) { - alert('Gagal mengirim ulang kode OTP'); + openAlert('Gagal mengirim ulang kode OTP', 'Error', 'danger'); $('#resend-btn').prop('disabled', false).html( ' Kirim Ulang'); } diff --git a/resources/views/auth/otp2fa/verify-settings.blade.php b/resources/views/auth/otp2fa/verify-settings.blade.php index ff6e10c5f..9eee72061 100644 --- a/resources/views/auth/otp2fa/verify-settings.blade.php +++ b/resources/views/auth/otp2fa/verify-settings.blade.php @@ -191,7 +191,7 @@ function updateOtpValue() { if (expirySeconds <= 0) { clearInterval(expiryInterval); clearInterval(resendInterval); - alert('Kode verifikasi telah kadaluarsa. Silakan minta kode baru.'); + openAlert('Kode verifikasi telah kadaluarsa. Silakan minta kode baru.', 'Info'); window.location.href = '{{ route('otp2fa.index') }}'; } }, 1000); @@ -210,7 +210,7 @@ function updateOtpValue() { purpose: 'settings_verification' }, success: function(response) { - alert(response.message); + openAlert(response.message, 'Info', 'success'); // Reset timer expirySeconds = expiryMinutes * 60; @@ -236,7 +236,7 @@ function updateOtpValue() { }, 1000); }, error: function(xhr) { - alert('Gagal mengirim ulang kode verifikasi'); + openAlert('Gagal mengirim ulang kode verifikasi', 'Error', 'danger'); $('#resend-btn').prop('disabled', false).html( ' Kirim Ulang'); } diff --git a/resources/views/components/modal-alert.blade.php b/resources/views/components/modal-alert.blade.php new file mode 100644 index 000000000..0140e30d8 --- /dev/null +++ b/resources/views/components/modal-alert.blade.php @@ -0,0 +1,14 @@ + diff --git a/resources/views/components/modal-confirm.blade.php b/resources/views/components/modal-confirm.blade.php new file mode 100644 index 000000000..cf7ace6cb --- /dev/null +++ b/resources/views/components/modal-confirm.blade.php @@ -0,0 +1,15 @@ + diff --git a/resources/views/data/data_sarana/partials/action.blade.php b/resources/views/data/data_sarana/partials/action.blade.php index 88e478b13..3cb9ac1eb 100644 --- a/resources/views/data/data_sarana/partials/action.blade.php +++ b/resources/views/data/data_sarana/partials/action.blade.php @@ -9,7 +9,7 @@
@csrf @method('DELETE') -
diff --git a/resources/views/data/pengurus/create.blade.php b/resources/views/data/pengurus/create.blade.php index 58726b1fd..9fd1c40b8 100644 --- a/resources/views/data/pengurus/create.blade.php +++ b/resources/views/data/pengurus/create.blade.php @@ -65,7 +65,7 @@ function readURL(input) { } else { //no //warning $("#foto").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/data/pengurus/edit.blade.php b/resources/views/data/pengurus/edit.blade.php index a08c10a64..13c8b4993 100644 --- a/resources/views/data/pengurus/edit.blade.php +++ b/resources/views/data/pengurus/edit.blade.php @@ -66,7 +66,7 @@ function readURL(input) { } else { //no //warning $("#foto").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/data/pengurus/form_create_arsip.blade.php b/resources/views/data/pengurus/form_create_arsip.blade.php index 6ea15dc60..4155cc2ff 100644 --- a/resources/views/data/pengurus/form_create_arsip.blade.php +++ b/resources/views/data/pengurus/form_create_arsip.blade.php @@ -74,7 +74,7 @@ }, error: function(xhr, status, error) { console.error(error); - alert("Terjadi kesalahan saat mengambil data."); + openAlert("Terjadi kesalahan saat mengambil data.", "Error", "danger"); } }); } diff --git a/resources/views/data/pengurus/form_edit_arsip.blade.php b/resources/views/data/pengurus/form_edit_arsip.blade.php index 7f66ddf14..ab7872388 100644 --- a/resources/views/data/pengurus/form_edit_arsip.blade.php +++ b/resources/views/data/pengurus/form_edit_arsip.blade.php @@ -78,7 +78,7 @@ }, error: function(xhr, status, error) { console.error(error); - alert("Terjadi kesalahan saat mengambil data."); + openAlert("Terjadi kesalahan saat mengambil data.", "Error", "danger"); } }); } diff --git a/resources/views/informasi/artikel/_form.blade.php b/resources/views/informasi/artikel/_form.blade.php index 4f6f3ffee..2b6977946 100644 --- a/resources/views/informasi/artikel/_form.blade.php +++ b/resources/views/informasi/artikel/_form.blade.php @@ -107,7 +107,7 @@ function readURL(input) { } else { //no //warning $("#file-artikel").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/media_sosial/create.blade.php b/resources/views/informasi/media_sosial/create.blade.php index 8da47df09..891548655 100644 --- a/resources/views/informasi/media_sosial/create.blade.php +++ b/resources/views/informasi/media_sosial/create.blade.php @@ -73,7 +73,7 @@ function readURL(input) { } else { //no //warning $("#logo").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/media_sosial/edit.blade.php b/resources/views/informasi/media_sosial/edit.blade.php index 3ea219246..709911a54 100644 --- a/resources/views/informasi/media_sosial/edit.blade.php +++ b/resources/views/informasi/media_sosial/edit.blade.php @@ -74,7 +74,7 @@ function readURL(input) { } else { //no //warning $("#logo").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/prosedur/create.blade.php b/resources/views/informasi/prosedur/create.blade.php index 3dfc3445a..25eb738c6 100644 --- a/resources/views/informasi/prosedur/create.blade.php +++ b/resources/views/informasi/prosedur/create.blade.php @@ -81,7 +81,7 @@ function readURL(input) { } else { //no //warning $("#file_prosedur").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/prosedur/edit.blade.php b/resources/views/informasi/prosedur/edit.blade.php index 45ad78082..be1ff467f 100644 --- a/resources/views/informasi/prosedur/edit.blade.php +++ b/resources/views/informasi/prosedur/edit.blade.php @@ -79,7 +79,7 @@ function readURL(input) { } else { //no //warning $("#file_prosedur").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/regulasi/form_create.blade.php b/resources/views/informasi/regulasi/form_create.blade.php index 3fa493c59..7aacb9cc3 100644 --- a/resources/views/informasi/regulasi/form_create.blade.php +++ b/resources/views/informasi/regulasi/form_create.blade.php @@ -73,7 +73,7 @@ function readURL(input) { } else { //no //warning $("#file_regulasi").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/regulasi/form_update.blade.php b/resources/views/informasi/regulasi/form_update.blade.php index 3e895429e..9b34e95fa 100644 --- a/resources/views/informasi/regulasi/form_update.blade.php +++ b/resources/views/informasi/regulasi/form_update.blade.php @@ -73,7 +73,7 @@ function readURL(input) { } else { //no //warning $("#file_regulasi").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/sinergi_program/create.blade.php b/resources/views/informasi/sinergi_program/create.blade.php index d3455596e..d421d3dca 100644 --- a/resources/views/informasi/sinergi_program/create.blade.php +++ b/resources/views/informasi/sinergi_program/create.blade.php @@ -73,7 +73,7 @@ function readURL(input) { } else { //no //warning $("#gambar").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/informasi/sinergi_program/edit.blade.php b/resources/views/informasi/sinergi_program/edit.blade.php index effcccf0f..c983464d1 100644 --- a/resources/views/informasi/sinergi_program/edit.blade.php +++ b/resources/views/informasi/sinergi_program/edit.blade.php @@ -77,7 +77,7 @@ function readURL(input) { } else { //no //warning $("#gambar").val(''); - alert('File tersebut tidak diperbolehkan.'); + openAlert('File tersebut tidak diperbolehkan.', 'Peringatan', 'warning'); } } } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 03f642e27..348917baa 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -195,31 +195,22 @@ let livewireInstance = typeof window.livewire !== 'undefined' ? window.livewire : Livewire; livewireInstance.on('success', (message) => { - Swal.fire({ - position: 'center', - icon: 'success', - title: message, - showConfirmButton: true, - timer: 1500 - }) + openAlert(message, 'Sukses', 'success'); $('#myModal').modal('hide'); }); livewireInstance.on('error', (message) => { - Swal.fire({ - position: 'center', - icon: 'error', - title: message, - showConfirmButton: true, - timer: 1500 - }) - + openAlert(message, 'Error', 'danger'); }); }) @livewireScripts + + + + diff --git a/resources/views/layouts/dashboard_template.blade.php b/resources/views/layouts/dashboard_template.blade.php index e4d2cca63..7694fb144 100644 --- a/resources/views/layouts/dashboard_template.blade.php +++ b/resources/views/layouts/dashboard_template.blade.php @@ -99,6 +99,9 @@ + + + @stack('scripts')