<!-- templates/partials/modal.html.twig -->
<div class="modal fade" id="feedbackModal" tabindex="-1" aria-labelledby="feedbackModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="feedbackModalLabel">Hinweis</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
{% for message in app.flashes('success') %}
<div class="alert alert-success">{{ message }}</div>
{% endfor %}
{% for message in app.flashes('error') %}
<div class="alert alert-danger">{{ message }}</div>
{% endfor %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">OK</button>
</div>
</div>
</div>
</div>
<script>
document.addEventListener('DOMContentLoaded', function () {
// Prüfen, ob es Flash-Nachrichten für 'success' oder 'error' gibt
if (document.querySelectorAll('.alert').length > 0) {
var feedbackModal = new bootstrap.Modal(document.getElementById('feedbackModal'));
feedbackModal.show();
}
});
</script>