add form help blocks: DB table, admin editor, live rendering in partage form

This commit is contained in:
Pontoporeia
2026-04-29 21:08:09 +02:00
parent 0437ec8d15
commit 670a38f30d
7 changed files with 136 additions and 29 deletions

15
TODO.md
View File

@@ -39,6 +39,21 @@
- [x] Update `root` directive in `nginx/posterg.conf`
- [x] Update `STORAGE_ROOT` production path in `app/bootstrap.php`
## Form Help Blocks (student-facing explanatory text)
- [x] Migration `004_add_form_help_blocks.sql``form_help_blocks` table with 8 seeded keys
- [x] `Database` methods: `getFormHelpBlock`, `setFormHelpBlock`, `getAllFormHelpBlocks`, `FORM_HELP_KEYS`, `FORM_HELP_LABELS`
- [x] `actions/form-help.php` — CSRF-validated save handler
- [x] `actions/page.php` — CSRF-validated save handler for static pages (was missing)
- [x] `contenus.php` controller — load `$formHelpBlocks`, add CSRF token
- [x] `contenus-edit.php` controller — handle `?form_block=<key>` route
- [x] `templates/admin/contenus.php` — flash messages + form help blocks table with edit links
- [x] `templates/admin/contenus-edit.php``form_help` edit branch with OverType Markdown editor
- [x] `templates/partials/form/form-help-block.php` — renders Markdown block via Parsedown (safe mode), silent on empty
- [x] `partage/index.php` — load all blocks once, inject at all 8 positions (replaced TODO comments)
- [x] `form.css``.form-help-block` styled with accent left-border
- [x] `admin.css``.muted` utility class
## Centralise Form Templates
- [x] Extract shared fieldset partials: `fieldset-tfe-info.php`, `fieldset-academic.php`, `fieldset-files.php`, `fieldset-metadata.php`, `fieldset-licence-explanation.php`