fix: remove broken flash-messages include from admin footer; make repertoire columns scrollable

This commit is contained in:
Pontoporeia
2026-04-21 19:25:54 +02:00
parent 19ef2a11dc
commit 362688c0fa
7 changed files with 42 additions and 24 deletions

View File

@@ -0,0 +1,32 @@
<?php
/**
* Toast fragment endpoint — HTMX target.
*
* Reads flash messages from the session and returns the toast markup.
* Returns an empty 204 when there is nothing to show.
* Called via hx-get on the #toast-region aside in the admin footer.
*/
require_once __DIR__ . '/../../bootstrap.php';
require_once __DIR__ . '/../../src/AdminAuth.php';
AdminAuth::requireLogin();
$flash = App::consumeFlash();
if (!$flash['error'] && !$flash['success']) {
http_response_code(204);
exit;
}
?>
<?php if ($flash['error']): ?>
<p class="toast toast--error" role="alert">
<span class="toast__icon" aria-hidden="true">⚠</span>
<?= htmlspecialchars($flash['error']) ?>
</p>
<?php endif; ?>
<?php if ($flash['success']): ?>
<p class="toast toast--success" role="status">
<span class="toast__icon" aria-hidden="true">✓</span>
<?= htmlspecialchars($flash['success']) ?>
</p>
<?php endif; ?>