merge head/nav templates into unified head.php + header.php; semantic CSS for nav

This commit is contained in:
Pontoporeia
2026-03-31 22:22:56 +02:00
parent 4ff959a72d
commit 780b1b2a13
24 changed files with 162 additions and 137 deletions

22
TODO.md
View File

@@ -1,15 +1,11 @@
# TODO
## Done
- [x] Replace unicode left arrow (←) with SVG arrow icon in admin nav logo
## Fixes
- [x] Fix CSV import UNIQUE constraint crash: skip rows whose identifier already exists in DB
- [x] Auto-migrate both test.db and posterg.db on `just serve` via scripts/migrate.sh
- [x] Fix wrong `require_once` depth in `public/admin/actions/page.php` (`../../``../../../`)
- [x] Fix same path depth bug in `formulaire.php` and `publish.php`
- [x] Fix CSV import: imported theses not visible on public site (is_published defaulted to 0, access_type_id never set)
- [x] Fix DB routing: local dev (php -S) auto-uses test.db, production (nginx/fpm) uses posterg.db — no env var needed
- [x] migrate.sh auto-initialises DB from schema when absent/empty; existing DBs untouched
- [x] Consolidate admin/public templates: shared head.php, admin/nav.php partial, common.css loaded first in admin, removed duplicate a11y CSS
- [x] admin/head.php now includes public/head.php as base (single source of boilerplate); removed duplicate font-family from .admin-body; wired templates/footer.php to all public pages; fixed duplicate body{} in common.css
## Completed
- [x] Merge public and admin head/nav templates into unified `templates/head.php` and `templates/header.php`
- `templates/head.php` — outputs `<!DOCTYPE html>…</head><body class="…">`, reads `$bodyClass`, `$isAdmin`; handles admin title suffix, admin.css prepend, and OG tag suppression internally
- `templates/header.php` — outputs `<header>…</header>` with public nav + search bar or admin nav depending on `$isAdmin`
- Deleted: `templates/public/head.php`, `templates/admin/head.php`, `templates/nav.php`, `templates/admin/nav.php`
- All 11 admin pages and 5 public pages updated to set `$bodyClass` / `$isAdmin` and include new templates
- [x] Replace nav/header BEM custom classes with semantic HTML targeting in CSS
- `common.css`: `.site-nav``header nav`, `.site-nav__logo``header nav > a`, etc.
- `admin.css`: `.admin-nav``.admin-body header nav`, logout via `[data-nav-logout]` attribute