feat: extract MediaController, wire into Dispatcher, delete media.php

This commit is contained in:
Pontoporeia
2026-04-17 11:44:08 +02:00
parent b03be51b92
commit 75f808bee4
157 changed files with 1713 additions and 452 deletions

View File

@@ -0,0 +1,39 @@
<?php include APP_ROOT . '/templates/partials/flash-messages.php'; ?>
<!-- Fixed toast container (bottom-center, always visible) -->
<div id="toast-container" aria-live="polite"></div>
<?php foreach ($extraJs ?? [] as $js): ?>
<script src="<?= App::assetV($js) ?>"></script>
<?php endforeach; ?>
<?php if (!empty($extraJsInline)): ?>
<script><?= $extraJsInline ?></script>
<?php endif; ?>
<script src="/assets/js/htmx.min.js"></script>
<script>
(function () {
var box = document.getElementById('toast-container');
if (!box) return;
// 1) Flash messages from hidden #admin-toasts
var src = document.getElementById('admin-toasts');
if (src) {
src.querySelectorAll('.toast').forEach(function (t) { box.appendChild(t); });
src.remove();
}
// 2) Orphaned .toast elements rendered inline by pages (login, thanks, etc.)
document.querySelectorAll('.toast:not(#toast-container .toast)')
.forEach(function (t) { box.appendChild(t); });
// Auto-dismiss every toast after 4 seconds
box.querySelectorAll('.toast').forEach(function (toast, i) {
setTimeout(function () {
toast.classList.add('toast-exit');
toast.addEventListener('animationend', function () { toast.remove(); });
}, 4000 + (i * 200));
});
})();
</script>
</body>
</html>