43 lines
1.6 KiB
HTML
43 lines
1.6 KiB
HTML
<!-- Cancellation Reason Modal -->
|
|
<div class="modal fade" id="cancellationReasonModal" tabindex="-1" aria-labelledby="cancellationReasonModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="cancellationReasonModalLabel">Cancellation Reason</h5>
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div id="cancellationReasonContent" class="p-3 bg-light rounded">
|
|
<!-- Cancellation reason content will be loaded here -->
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script>
|
|
function viewCancellationReason(meetingId) {
|
|
fetch(`/api/meetings/${meetingId}/cancellation-reason/`)
|
|
.then(response => {
|
|
if (!response.ok) {
|
|
throw new Error('Network response was not ok: ' + response.statusText);
|
|
}
|
|
return response.json();
|
|
})
|
|
.then(data => {
|
|
document.getElementById('cancellationReasonContent').innerHTML = data.reason || 'No reason provided';
|
|
new bootstrap.Modal(document.getElementById('cancellationReasonModal')).show();
|
|
})
|
|
.catch(error => {
|
|
console.error('Error fetching cancellation reason:', error);
|
|
showToast('Failed to load cancellation reason', 'error');
|
|
});
|
|
}
|
|
|
|
function closeCancellationReasonModal() {
|
|
bootstrap.Modal.getInstance(document.getElementById('cancellationReasonModal')).hide();
|
|
}
|
|
</script> |