From 780b1b2a13a23be6be8546f5e0a356494cf65758 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Tue, 31 Mar 2026 22:22:56 +0200 Subject: [PATCH] merge head/nav templates into unified head.php + header.php; semantic CSS for nav --- TODO.md | 22 ++++----- public/admin/account.php | 3 +- public/admin/add.php | 3 +- public/admin/edit.php | 3 +- public/admin/import.php | 3 +- public/admin/index.php | 3 +- public/admin/login.php | 3 +- public/admin/pages-edit.php | 3 +- public/admin/pages.php | 3 +- public/admin/system.php | 3 +- public/admin/tags.php | 3 +- public/admin/thanks.php | 3 +- public/apropos.php | 9 ++-- public/assets/css/admin.css | 28 ++++++------ public/assets/css/common.css | 20 +++++---- public/index.php | 9 ++-- public/licence.php | 9 ++-- public/search.php | 9 ++-- public/tfe.php | 9 ++-- templates/admin/head.php | 11 ----- templates/admin/nav.php | 26 ----------- templates/{public => }/head.php | 11 ++++- templates/header.php | 80 +++++++++++++++++++++++++++++++++ templates/nav.php | 23 ---------- 24 files changed, 162 insertions(+), 137 deletions(-) delete mode 100644 templates/admin/head.php delete mode 100644 templates/admin/nav.php rename templates/{public => }/head.php (90%) create mode 100644 templates/header.php delete mode 100644 templates/nav.php diff --git a/TODO.md b/TODO.md index cd459dc..8d4d46f 100644 --- a/TODO.md +++ b/TODO.md @@ -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 `…`, reads `$bodyClass`, `$isAdmin`; handles admin title suffix, admin.css prepend, and OG tag suppression internally + - `templates/header.php` — outputs `
` 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 diff --git a/public/admin/account.php b/public/admin/account.php index c203ef9..a765500 100644 --- a/public/admin/account.php +++ b/public/admin/account.php @@ -16,7 +16,8 @@ if (empty($_SESSION['csrf_token'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); } ?> - + +

Compte administrateur

diff --git a/public/admin/add.php b/public/admin/add.php index a49554a..0b5e3a2 100644 --- a/public/admin/add.php +++ b/public/admin/add.php @@ -39,7 +39,8 @@ function wasSelected($key, $value) { return $formData[$key] == $value; } ?> - + +

Ajouter un TFE

diff --git a/public/admin/edit.php b/public/admin/edit.php index 88c2ad5..bca45f2 100644 --- a/public/admin/edit.php +++ b/public/admin/edit.php @@ -61,7 +61,8 @@ try { die("Erreur lors du chargement: " . $e->getMessage()); } ?> - + +

Modifier un TFE

diff --git a/public/admin/import.php b/public/admin/import.php index 0cab481..c1a0d29 100644 --- a/public/admin/import.php +++ b/public/admin/import.php @@ -317,7 +317,8 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_FILES['csv_file'])) { $_SESSION['csrf_token'] = bin2hex(random_bytes(32)); } ?> - + +

Importer une liste de TFE

diff --git a/public/admin/index.php b/public/admin/index.php index c4f9395..9316407 100644 --- a/public/admin/index.php +++ b/public/admin/index.php @@ -30,7 +30,8 @@ try { die("Erreur lors du chargement de la liste."); } ?> - + + + diff --git a/templates/header.php b/templates/header.php new file mode 100644 index 0000000..79291cb --- /dev/null +++ b/templates/header.php @@ -0,0 +1,80 @@ + +
+ + + + + + + + + + + + + + + +
diff --git a/templates/nav.php b/templates/nav.php deleted file mode 100644 index 414211a..0000000 --- a/templates/nav.php +++ /dev/null @@ -1,23 +0,0 @@ - -