update
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
<!-- Generic Delete Confirmation Modal -->
|
||||
<div class="modal micromodal-slide" id="deleteConfirmationModal" aria-hidden="true">
|
||||
<div class="modal__overlay" tabindex="-1" data-micromodal-close>
|
||||
<div class="modal__container modal--sm" role="dialog" aria-modal="true" aria-labelledby="deleteConfirmationModalLabel">
|
||||
<header class="modal__header bg-primary text-white">
|
||||
<h6 class="modal__title" id="deleteConfirmationModalLabel">
|
||||
<i data-lucide="trash-2" class="w-15px h-15px me-2"></i>
|
||||
Confirm Delete
|
||||
</h6>
|
||||
<button class="modal__close" aria-label="Close modal" data-micromodal-close>
|
||||
<i data-lucide="x"></i>
|
||||
</button>
|
||||
</header>
|
||||
<main class="modal__content">
|
||||
<div class="text-center">
|
||||
<i data-lucide="alert-triangle" class="text-warning mb-3" style="width: 48px; height: 48px;"></i>
|
||||
<h6 class="mb-2">Are you sure?</h6>
|
||||
<p class="text-muted small mb-1">Delete item:</p>
|
||||
<p class="fw-bold mb-2"><span id="confirmDeleteItemName"></span></p>
|
||||
<p class="text-danger small mb-0">This action cannot be undone!</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="modal__footer">
|
||||
<x-button-crm type="button" variant="secondary" size="sm" icon="x" data-micromodal-close>Cancel</x-button-crm>
|
||||
<form id="confirmDeleteForm" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<x-button-crm type="submit" variant="danger" size="sm" icon="trash-2">Confirm Delete</x-button-crm>
|
||||
</form>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('custom-scripts')
|
||||
<script>
|
||||
window.confirmDelete = function(url, name) {
|
||||
const nameElement = document.getElementById('confirmDeleteItemName');
|
||||
const formElement = document.getElementById('confirmDeleteForm');
|
||||
|
||||
if (nameElement && formElement) {
|
||||
nameElement.textContent = name;
|
||||
formElement.action = url;
|
||||
if (typeof ModalManager !== 'undefined') {
|
||||
ModalManager.show('deleteConfirmationModal');
|
||||
} else {
|
||||
MicroModal.show('deleteConfirmationModal');
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user