Files
xamxam/templates/admin/head.php
Pontoporeia f2c023e19a admin nav: replace bare <a> links with <ul>/<li>, use aria-current instead of .active class
- templates/admin/head.php: all 7 nav links (+ conditional Modifier + Déconnexion)
  wrapped in <ul class="admin-nav__list">/<li>; .active class removed, replaced
  with aria-current="page" on each <a> based on $currentPage match
- Déconnexion link: removed inline style="margin-left:auto;opacity:.6;"; moved to
  new .admin-nav__logout <li> class in admin.css
- public/assets/admin.css: replaced .admin-nav__link rules with .admin-nav__list a
  selectors; added .admin-nav__list (flex list, gap 2.5rem, flex:1); added
  .admin-nav__list a[aria-current="page"] rule (border-bottom underline indicator);
  added .admin-nav__logout / .admin-nav__logout a for the push-right logout item
- Removes .admin-nav__link class entirely from the codebase (was only used in
  templates/admin/head.php and admin.css)

Fixes WCAG 2.4.6 (nav landmark content model), 1.4.1 (colour-only active indicator),
and section VIII of the semantic HTML admin audit.
2026-03-29 16:31:26 +02:00

47 lines
2.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><?= htmlspecialchars($pageTitle ?? 'Admin') ?> Posterg</title>
<link rel="icon" type="image/svg+xml" href="/assets/admin_favicon.svg">
<link rel="stylesheet" href="/assets/modern-normalize.min.css">
<link rel="stylesheet" href="/assets/admin.css">
<?php foreach ($extraCss ?? [] as $css): ?>
<link rel="stylesheet" href="<?= htmlspecialchars($css) ?>">
<?php endforeach; ?>
<?php if (php_sapi_name() === 'cli-server'): ?>
<script>
(function poll(){
fetch('/live-reload.php').then(r=>r.json()).then(d=>{
if(d.changed) location.reload(); else setTimeout(poll,1000);
}).catch(()=>setTimeout(poll,2000));
})();
</script>
<?php endif; ?>
</head>
<body class="admin-body">
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
<nav class="admin-nav" aria-label="Navigation admin">
<a href="/admin/" class="admin-nav__logo">Posterg</a>
<?php
$currentPage = basename($_SERVER['PHP_SELF']);
$thesisId = $_GET['id'] ?? null;
?>
<ul class="admin-nav__list">
<li><a href="/admin/" <?= $currentPage === 'index.php' ? 'aria-current="page"' : '' ?>>Liste des TFE</a></li>
<li><a href="/admin/add.php" <?= $currentPage === 'add.php' ? 'aria-current="page"' : '' ?>>Ajouter un TFE</a></li>
<li><a href="/admin/import.php" <?= $currentPage === 'import.php' ? 'aria-current="page"' : '' ?>>Importer une liste de TFE</a></li>
<li><a href="/admin/pages.php" <?= in_array($currentPage, ['pages.php','pages-edit.php']) ? 'aria-current="page"' : '' ?>>Pages statiques</a></li>
<li><a href="/admin/tags.php" <?= $currentPage === 'tags.php' ? 'aria-current="page"' : '' ?>>Mots-clés</a></li>
<li><a href="/admin/system.php" <?= in_array($currentPage, ['system.php','status.php','logs.php']) ? 'aria-current="page"' : '' ?>>Système</a></li>
<li><a href="/admin/account.php" <?= $currentPage === 'account.php' ? 'aria-current="page"' : '' ?>>Compte</a></li>
<?php if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])): ?>
<li><a href="/admin/edit.php?id=<?= intval($thesisId) ?>" <?= $currentPage === '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>