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

View File

@@ -1,11 +0,0 @@
<?php
// Admin head: builds on the shared public head.
// Sets admin defaults then delegates to public/head.php for the full <head> 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
?>
<?php include APP_ROOT . '/templates/public/head.php'; ?>
<body class="admin-body">
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
<?php include APP_ROOT . '/templates/admin/nav.php'; ?>

View File

@@ -1,26 +0,0 @@
<?php
// admin/nav.php — admin navigation bar
// Reads $pageTitle (set by each page) and $_GET['id'] for context-sensitive edit link.
$_adminCurrentPage = basename($_SERVER['PHP_SELF']);
$_adminThesisId = $_GET['id'] ?? null;
?>
<nav class="admin-nav" aria-label="Navigation admin">
<a href="/" class="admin-nav__logo" target="_blank" rel="noopener noreferrer">
<svg aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" viewBox="0 0 256 256" style="vertical-align:middle;margin-right:0.4em"><path d="M208,72H128V32a8,8,0,0,0-13.66-5.66l-96,96a8,8,0,0,0,0,11.32l96,96A8,8,0,0,0,128,224V184h80a16,16,0,0,0,16-16V88A16,16,0,0,0,208,72Zm0,96H120a8,8,0,0,0-8,8v28.69L35.31,128,112,51.31V80a8,8,0,0,0,8,8h88Z"></path></svg>Posterg<span class="sr-only"> (site public, nouvel onglet)</span>
</a>
<ul class="admin-nav__list">
<li><a href="/admin/" <?= $_adminCurrentPage === 'index.php' ? 'aria-current="page"' : '' ?>>Liste des TFE</a></li>
<li><a href="/admin/add.php" <?= $_adminCurrentPage === 'add.php' ? 'aria-current="page"' : '' ?>>Ajouter un TFE</a></li>
<li><a href="/admin/import.php" <?= $_adminCurrentPage === 'import.php' ? 'aria-current="page"' : '' ?>>Importer une liste de TFE</a></li>
<li><a href="/admin/pages.php" <?= in_array($_adminCurrentPage, ['pages.php', 'pages-edit.php']) ? 'aria-current="page"' : '' ?>>Pages statiques</a></li>
<li><a href="/admin/tags.php" <?= $_adminCurrentPage === 'tags.php' ? 'aria-current="page"' : '' ?>>Mots-clés</a></li>
<li><a href="/admin/system.php" <?= in_array($_adminCurrentPage, ['system.php', 'status.php', 'logs.php']) ? 'aria-current="page"' : '' ?>>Système</a></li>
<li><a href="/admin/account.php" <?= $_adminCurrentPage === 'account.php' ? 'aria-current="page"' : '' ?>>Compte</a></li>
<?php if ($_adminThesisId && in_array($_adminCurrentPage, ['edit.php', 'thanks.php'])): ?>
<li><a href="/admin/edit.php?id=<?= intval($_adminThesisId) ?>" <?= $_adminCurrentPage === 'edit.php' ? 'aria-current="page"' : '' ?>>Modifier</a></li>
<?php endif; ?>
<?php if (defined('ADMIN_PASSWORD_HASH')): ?>
<li class="admin-nav__logout"><a href="/admin/logout.php">Déconnexion</a></li>
<?php endif; ?>
</ul>
</nav>