From 4ff959a72d6d57448beb7a242eb09c96e4bae3a9 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Tue, 31 Mar 2026 22:03:15 +0200 Subject: [PATCH] fix template consolidation: admin/head.php wraps public/head.php, footer.php wired to all public pages, remove duplicate font-family and body reset --- TODO.md | 1 + public/apropos.php | 3 +-- public/assets/css/admin.css | 4 +--- public/index.php | 3 +-- public/licence.php | 3 +-- public/search.php | 3 +-- public/tfe.php | 3 +-- templates/admin/head.php | 31 ++++++++----------------------- templates/public/head.php | 1 + 9 files changed, 16 insertions(+), 36 deletions(-) diff --git a/TODO.md b/TODO.md index 20c6be2..cd459dc 100644 --- a/TODO.md +++ b/TODO.md @@ -12,3 +12,4 @@ - [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 diff --git a/public/apropos.php b/public/apropos.php index 5cc4523..a5219de 100644 --- a/public/apropos.php +++ b/public/apropos.php @@ -96,5 +96,4 @@ $extraCss = ['/assets/css/apropos.css']; - - + diff --git a/public/assets/css/admin.css b/public/assets/css/admin.css index 9dd6d33..eb9171c 100644 --- a/public/assets/css/admin.css +++ b/public/assets/css/admin.css @@ -18,9 +18,7 @@ min-height: 100vh; background: var(--admin-bg); color: var(--admin-text); - font-family: - -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", - Arial, sans-serif; + /* font-family inherited from common.css body */ } /* Admin nav (dark version of site-nav) */ diff --git a/public/index.php b/public/index.php index 5afe93c..1854033 100644 --- a/public/index.php +++ b/public/index.php @@ -165,5 +165,4 @@ $extraCss = ['/assets/css/main.css']; - - + diff --git a/public/licence.php b/public/licence.php index 7fe129c..615220b 100644 --- a/public/licence.php +++ b/public/licence.php @@ -48,5 +48,4 @@ $extraCss = ['/assets/css/apropos.css']; - - + diff --git a/public/search.php b/public/search.php index f05f382..d08410a 100644 --- a/public/search.php +++ b/public/search.php @@ -293,5 +293,4 @@ $extraCss = ['/assets/css/search.css']; - - + diff --git a/public/tfe.php b/public/tfe.php index e1d7649..af6cded 100644 --- a/public/tfe.php +++ b/public/tfe.php @@ -241,5 +241,4 @@ $extraCss = ['/assets/css/tfe.css']; - - + diff --git a/templates/admin/head.php b/templates/admin/head.php index 58bb419..169f81c 100644 --- a/templates/admin/head.php +++ b/templates/admin/head.php @@ -1,26 +1,11 @@ - - - - - - <?= htmlspecialchars($pageTitle ?? 'Admin') ?> – Posterg - - - - - - - - - - - + block. +$pageTitle = isset($pageTitle) ? $pageTitle . ' – Admin' : 'Admin'; +$extraCss = array_merge(['/assets/css/admin.css'], $extraCss ?? []); +$_adminHead = true; // flag so public/head.php knows to skip OG/meta +?> + diff --git a/templates/public/head.php b/templates/public/head.php index 6fb66c5..1b21dc9 100644 --- a/templates/public/head.php +++ b/templates/public/head.php @@ -4,6 +4,7 @@ <?= htmlspecialchars($pageTitle ?? 'Posterg') ?> +