From 3a42838cec4bedcfce66ee8be961971c14ecd790 Mon Sep 17 00:00:00 2001 From: Pontoporeia Date: Tue, 31 Mar 2026 21:32:40 +0200 Subject: [PATCH] consolidate admin/public templates: common.css base in admin, nav partial, remove duplicate CSS --- TODO.md | 1 + public/admin/login.php | 21 +++---------------- public/assets/css/admin.css | 40 ++----------------------------------- templates/admin/head.php | 26 ++---------------------- templates/admin/nav.php | 26 ++++++++++++++++++++++++ 5 files changed, 34 insertions(+), 80 deletions(-) create mode 100644 templates/admin/nav.php diff --git a/TODO.md b/TODO.md index 3179ce8..20c6be2 100644 --- a/TODO.md +++ b/TODO.md @@ -11,3 +11,4 @@ - [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 diff --git a/public/admin/login.php b/public/admin/login.php index 2cc19ae..4c633ce 100644 --- a/public/admin/login.php +++ b/public/admin/login.php @@ -23,22 +23,7 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $pageTitle = 'Connexion'; ?> - - - - - - Connexion – Posterg Admin - - - - - - +
- - + + diff --git a/public/assets/css/admin.css b/public/assets/css/admin.css index 705b007..9dd6d33 100644 --- a/public/assets/css/admin.css +++ b/public/assets/css/admin.css @@ -12,12 +12,6 @@ --admin-input-bg: transparent; } -html, body { - margin: 0; - padding: 0; - height: 100%; -} - .admin-body { display: flex; flex-direction: column; @@ -840,37 +834,7 @@ html, body { ACCESSIBILITY UTILITIES ============================================================ */ -/* Consistent keyboard-focus outline for admin interactive elements */ +/* Admin-specific focus outline colour override */ :focus-visible { - outline: 2px solid var(--admin-purple); - outline-offset: 2px; -} - -/* Skip-to-admin-content link */ -.skip-link { - position: absolute; - top: -999px; - left: 1rem; - z-index: 9999; - padding: 0.5rem 1rem; - background: var(--admin-purple); - color: #fff; - font-size: 0.9rem; - font-weight: 600; - text-decoration: none; - border-radius: 0 0 4px 4px; -} - -.skip-link:focus { - top: 0; -} - -/* Respect user motion preferences */ -@media (prefers-reduced-motion: reduce) { - *, - *::before, - *::after { - transition-duration: 0.01ms !important; - animation-duration: 0.01ms !important; - } + outline-color: var(--admin-purple); } diff --git a/templates/admin/head.php b/templates/admin/head.php index 9a092a1..58bb419 100644 --- a/templates/admin/head.php +++ b/templates/admin/head.php @@ -6,6 +6,7 @@ <?= htmlspecialchars($pageTitle ?? 'Admin') ?> – Posterg + @@ -22,27 +23,4 @@ - + diff --git a/templates/admin/nav.php b/templates/admin/nav.php new file mode 100644 index 0000000..2ba0bd5 --- /dev/null +++ b/templates/admin/nav.php @@ -0,0 +1,26 @@ + +