Update slide list and edit slide form without page reloads
Slide list actions (hide, delete, reset, duplicate, go live, pause) now run via fetch and refresh only the changed regions, keeping scroll position and focus. Add/edit slide forms open in a dialog. Admin pages answer with a slim fragment layout when the X-Fragment header is sent. Replace postLink confirms (inline onclick, blocked by the CSP) with postButton and data-confirm handled in plenario.js. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9262a57c17
commit
b643072c3c
9 files changed
+403
-32
No files matched your search
@@ -268,6 +268,15 @@ tests/ PHPUnit; PlenarioTestTrait erzeugt Testdaten, Fixtures
|
||||
externen Ressourcen, keine CSS-Variablen, Schrift DejaVu Sans; Seitenzahlen setzt `PdfView::addPageNumbers()`.
|
||||
Tests prüfen das HTML über `PlenarioTestTrait::exportHtml()` (das PDF selbst ist nicht durchsuchbar).
|
||||
|
||||
- **Dashboard ohne Neuladen** (`initAdminDashboard()`, `Fragments` in `plenario.js`): Formulare in `[data-live]` (Folienliste, Kopf)
|
||||
und das Folienformular im `<dialog>` laufen per `fetch` mit Header `X-Fragment`; `AdminAppController::beforeRender()` nimmt dann
|
||||
das Layout `fragment` (nur Inhalt + Flash). Die Server-Aktionen bleiben normale POST + Redirect, das JS tauscht die Bereiche
|
||||
`[data-refresh="head|slides|flash"]` (als DOM-Knoten, nie `innerHTML`) und stellt den Fokus wieder her. Bearbeiten/Anlegen:
|
||||
Links mit `data-modal` laden das Formular (`[data-modal-content]`) in den Dialog; Validierungsfehler kommen als Formular
|
||||
zurück (Dialog bleibt offen), Erfolg als Dashboard-Fragment (Dialog schließt). Ohne JS funktioniert alles als normale Seite.
|
||||
**Buttons mit Bestätigung** nutzen `Form->postButton()` + `data-confirm` (CakePHPs `postLink`/`confirm` erzeugt ein Inline-`onclick`,
|
||||
das die CSP blockiert); das JS fragt per `window.confirm()` vor dem Absenden. Tests: `AdminFragmentTest.php`.
|
||||
|
||||
### Neuen Folientyp hinzufügen (Checkliste)
|
||||
|
||||
1. Konstante + Label + Beschreibung + `DEFAULT_SETTINGS` in `src/Model/Entity/Slide.php`
|
||||
|
||||
Reference in new issue
Block a user