Clean up flash key legacy code and extract import.php inline styles

App::consumeFlash() had 18-line legacy fallback chains reading from seven old
session keys (error, admin_error, edit_error, form_error, success,
admin_success, edit_success) that were written by no code in the codebase.
All action handlers have used App::flash() -> _flash_error / _flash_success
since the App class was introduced. Removed the dead fallbacks; consumeFlash()
is now 4 lines.

admin/import.php was the last admin template with inline style= attributes.
Extracted four of them to named CSS classes in admin.css:
- admin-error-list   — error <ul> spacing (was style="margin:.5rem 0 0;padding-left:1.2rem")
- admin-file-hint    — <small> display + margin (was style="margin-top:.5rem")
- admin-import-results        — results panel margin (was style="margin-top:2rem")
- admin-import-results__title — <h2> typography (was multi-property inline style)

Closes the 'unify flash message keys' item in todo/02-php-components.md and
the import.php inline style item in todo/01-css-semantic-refactor.md.
This commit is contained in:
Pontoporeia
2026-04-04 12:31:08 +02:00
parent c2eff75789
commit 9637114f6b
6 changed files with 41 additions and 30 deletions

View File

@@ -53,6 +53,8 @@
- [x] **`login.php`**: Wrap login content in `<main>` (currently no main landmark)
- [x] **`login.php`**: Extract inline styles on `.admin-form-row` and `.admin-form-footer``login.php` has no `style=` attributes; `.admin-login-box` modifier in `admin.css` already handles the compact layout
- [x] **`admin/import.php` inline styles** — extracted 4 inline `style=` attributes to CSS classes: `admin-error-list` (error `<ul>` margins), `admin-file-hint` (`<small>` display block + margin), `admin-import-results` (results panel `margin-top`), `admin-import-results__title` (results `<h2>` typography). All rules added to `admin.css` Import page section.
## Favicon
- [x] **`admin_favicon.svg` used as public-facing favicon** — created `public/assets/favicon.svg` (brand purple `#9557b5` lettermark “P”); `templates/head.php` now serves `favicon.svg` on public pages and `admin_favicon.svg` on admin pages

View File

@@ -21,7 +21,7 @@
- [ ] Extract `ThesisEditController` — merges `edit.php` + `actions/edit.php`, deduplicates jury fieldset
- [ ] Extract remaining controllers one by one
- [ ] Consolidate action handlers into controller methods
- [ ] Unify flash message keys project-wide to `_flash_error` / `_flash_success`
- [x] Unify flash message keys project-wide to `_flash_error` / `_flash_success` — all callers already use `App::flash()`; removed dead legacy-key fallback chains (`error`, `admin_error`, `edit_error`, `form_error`, `success`, `admin_success`, `edit_success`) from `consumeFlash()`
- [ ] Move OG tag construction into controller logic
- [ ] Extract inline CSS/JS from `system.php` into separate assets