mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 11:09:18 +02:00
Move the repeated 'html, body { margin:0; padding:0; height:100% }' block from
main.css, search.css, tfe.css, and apropos.css into the single canonical location
in common.css. All four public page stylesheets already load common.css first, so
the rule applies identically — no visual change.
Fix pages-edit.php invalid HTML: the EasyMDE <link rel=stylesheet> was placed
inside <body> (after head.php was already closed), which is invalid. Add an
$extraCss hook to templates/admin/head.php so pages can inject <link> tags into
<head> via an array variable, matching the pattern already used by the public
templates/public/head.php. Also add a symmetric $extraJs hook to
templates/admin/footer.php for future use. pages-edit.php now sets
$extraCss = ['easymde.min.css'] before requiring head.php; the EasyMDE JS
<script> and its inline init remain in <body> in the correct load order.
45 lines
2.6 KiB
PHP
45 lines
2.6 KiB
PHP
<!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;
|
||
?>
|
||
<a href="/admin/" class="admin-nav__link <?= $currentPage === 'index.php' ? 'active' : '' ?>">Liste des TFE</a>
|
||
<a href="/admin/add.php" class="admin-nav__link <?= $currentPage === 'add.php' ? 'active' : '' ?>">Ajouter un TFE</a>
|
||
<a href="/admin/import.php" class="admin-nav__link <?= $currentPage === 'import.php' ? 'active' : '' ?>">Importer une liste de TFE</a>
|
||
<a href="/admin/pages.php" class="admin-nav__link <?= in_array($currentPage, ['pages.php','pages-edit.php']) ? 'active' : '' ?>">Pages statiques</a>
|
||
<a href="/admin/tags.php" class="admin-nav__link <?= $currentPage === 'tags.php' ? 'active' : '' ?>">Mots-clés</a>
|
||
<a href="/admin/system.php" class="admin-nav__link <?= in_array($currentPage, ['system.php','status.php','logs.php']) ? 'active' : '' ?>">Système</a>
|
||
<a href="/admin/account.php" class="admin-nav__link <?= $currentPage === 'account.php' ? 'active' : '' ?>">Compte</a>
|
||
<?php if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])): ?>
|
||
<a href="/admin/edit.php?id=<?= intval($thesisId) ?>" class="admin-nav__link <?= $currentPage === 'edit.php' ? 'active' : '' ?>">Modifier</a>
|
||
<?php endif; ?>
|
||
<?php if (defined('ADMIN_PASSWORD_HASH')): ?>
|
||
<a href="/admin/logout.php" class="admin-nav__link" style="margin-left:auto;opacity:.6;">Déconnexion</a>
|
||
<?php endif; ?>
|
||
</nav>
|