update
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
<!-- Delete Confirmation Modal -->
|
||||
<div class="modal micromodal-slide" id="deleteModal" 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="deleteModalLabel">
|
||||
<header class="modal__header bg-primary text-white">
|
||||
<h6 class="modal__title" id="deleteModalLabel">
|
||||
<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 OS Version:</p>
|
||||
<p class="fw-bold mb-2"><span id="deleteItemName"></span></p>
|
||||
<p class="text-danger small mb-0">This action cannot be undone!</p>
|
||||
</div>
|
||||
</main>
|
||||
<footer class="modal__footer">
|
||||
<button type="button" class="btn btn-outline-secondary btn-sm me-2" data-micromodal-close>
|
||||
<i data-lucide="x" class="me-1"></i>
|
||||
Cancel
|
||||
</button>
|
||||
<form id="deleteForm" method="POST" class="d-inline">
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit" class="btn btn-primary btn-sm">
|
||||
<i data-lucide="trash-2" class="me-1"></i>
|
||||
Delete
|
||||
</button>
|
||||
</form>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('custom-scripts')
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
function initializeModal() {
|
||||
if (typeof ModalManager !== 'undefined') {
|
||||
window.showDeleteModal = function(id, name) {
|
||||
// Update modal content
|
||||
const nameElement = document.getElementById('deleteItemName');
|
||||
const formElement = document.getElementById('deleteForm');
|
||||
|
||||
if (nameElement && formElement) {
|
||||
nameElement.textContent = name;
|
||||
formElement.action = `/administrator/package/version/remove-os-version/${id}`;
|
||||
ModalManager.show('deleteModal');
|
||||
} else {
|
||||
console.error('Modal elements not found');
|
||||
}
|
||||
};
|
||||
|
||||
} else {
|
||||
console.warn('ModalManager not available, retrying...');
|
||||
setTimeout(initializeModal, 100);
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(initializeModal, 50);
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user