mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Redesign UI to match target design images
- Flat purple-gradient nav bar with POSTERG/RÉPERTOIRE/À PROPOS links - Full-width search bar with icon, bottom-border only, below nav - Home: white bg, media card grid (thumbnail + author/title label below) - Répertoire: 4-column index (Années/Catégories/Étudiantes/Mots-clés) - TFE: 2-column layout (large text left, media right) - À Propos: 2-column, large monospace text, new apropos.php page - Admin: dark theme (#1a1a1a), purple gradient nav, bottom-border inputs - New shared partials: templates/nav.php, templates/search-bar.php - Rewrote all CSS: common, main, search, tfe, apropos, admin
This commit is contained in:
@@ -1,6 +1,2 @@
|
||||
<footer>
|
||||
<p>Formulaire fait avec ❤ en PHP et <a href="https://watercss.kognise.dev/">Water.css</a>.</p>
|
||||
</footer>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
</html>
|
||||
|
||||
@@ -1,71 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title><?php echo htmlspecialchars($pageTitle ?? 'Admin'); ?> - Post-ERG</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?= htmlspecialchars($pageTitle ?? 'Admin') ?> – Posterg</title>
|
||||
<link rel="stylesheet" href="/assets/modern-normalize.min.css">
|
||||
<link rel="stylesheet" href="/assets/admin.css">
|
||||
<link rel="shortcut icon" href="/assets/admin_favicon.svg" type="image/svg+xml">
|
||||
<?php if (php_sapi_name() === 'cli-server'): ?>
|
||||
<!-- Live reload for development -->
|
||||
<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>
|
||||
<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>
|
||||
<header>
|
||||
<h1><?php echo htmlspecialchars($pageTitle ?? 'Admin'); ?></h1>
|
||||
<nav>
|
||||
<?php
|
||||
// Detect current page
|
||||
$currentPage = basename($_SERVER['PHP_SELF']);
|
||||
$thesisId = $_GET['id'] ?? null;
|
||||
|
||||
// Build navigation based on context
|
||||
$navLinks = [];
|
||||
|
||||
// Always show list
|
||||
if ($currentPage !== 'index.php') {
|
||||
$navLinks[] = '<a href="/admin/"><button>📋 Liste des TFE</button></a>';
|
||||
}
|
||||
|
||||
// Show add thesis if not on add page
|
||||
if ($currentPage !== 'add.php') {
|
||||
$navLinks[] = '<a href="/admin/add.php"><button>➕ Ajouter un TFE</button></a>';
|
||||
}
|
||||
|
||||
// Show import if not on import page
|
||||
if ($currentPage !== 'import.php') {
|
||||
$navLinks[] = '<a href="/admin/import.php"><button>📥 Importer CSV</button></a>';
|
||||
}
|
||||
|
||||
// If on edit or thanks page with thesis ID, show edit and view links
|
||||
if ($thesisId && in_array($currentPage, ['edit.php', 'thanks.php'])) {
|
||||
if ($currentPage !== 'edit.php') {
|
||||
$navLinks[] = '<a href="/admin/edit.php?id=' . intval($thesisId) . '"><button>✏️ Modifier</button></a>';
|
||||
}
|
||||
if ($currentPage !== 'thanks.php') {
|
||||
$navLinks[] = '<a href="/admin/thanks.php?id=' . intval($thesisId) . '"><button>👁️ Voir</button></a>';
|
||||
}
|
||||
}
|
||||
|
||||
echo implode(' ', $navLinks);
|
||||
?>
|
||||
<?php if (defined('ADMIN_PASSWORD_HASH')): ?>
|
||||
<a href="/admin/logout.php"><button>🔐 Déconnexion</button></a>
|
||||
<?php endif; ?>
|
||||
</nav>
|
||||
</header>
|
||||
<body class="admin-body">
|
||||
<nav class="admin-nav">
|
||||
<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>
|
||||
<?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>
|
||||
|
||||
Reference in New Issue
Block a user