mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
fix: remove broken flash-messages include from admin footer; make repertoire columns scrollable
This commit is contained in:
32
app/public/admin/toast-fragment.php
Normal file
32
app/public/admin/toast-fragment.php
Normal 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; ?>
|
||||
Reference in New Issue
Block a user