mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-07 03:29:19 +02:00
Create templates/public/head.php accepting $pageTitle and $extraCss (array of stylesheet hrefs), mirroring the existing templates/admin/head.php pattern. The partial emits: DOCTYPE, <html lang=fr>, charset/viewport meta, favicon, modern-normalize, common.css, any extra CSS links, and the dev-only live-reload script. The live-reload snippet was previously copy-pasted verbatim into all five public pages. Updated pages: - public/index.php ($pageTitle='Posterg', $extraCss=['assets/main.css']) - public/search.php ($pageTitle='Répertoire – Posterg', search.css) - public/tfe.php ($pageTitle=thesis title + suffix, tfe.css) - public/apropos.php ($pageTitle='À Propos – Posterg', apropos.css) - public/licence.php ($pageTitle=DB title + suffix, apropos.css) tfe.php: removed redundant htmlspecialchars() call on $pageTitle (the partial applies it); licence.php: renamed conflicting $page variable to $dbPage to avoid collision with the shared $pageTitle expected by the partial. All syntax checks and test suite pass (4/4).
95 lines
3.9 KiB
PHP
95 lines
3.9 KiB
PHP
<?php
|
||
require_once __DIR__ . '/../config/bootstrap.php';
|
||
require_once APP_ROOT . '/src/Database.php';
|
||
require_once APP_ROOT . '/src/Parsedown.php';
|
||
|
||
$currentNav = 'apropos';
|
||
|
||
// Fallback static content used when DB content is the placeholder
|
||
define('APROPOS_STATIC_CONTENT', "Ce site POSTERG a été créé pour répertorier et valoriser les mémoires de l'erg – École de Recherches Graphique de Bruxelles.\n\nL'objectif est à la fois d'offrir une vitrine aux projets des anciens étudiantes et de mettre en lumière la diversité des disciplines et des parcours qui façonnent l'histoire de l'école à travers les âges, depuis près de 100 ans.");
|
||
|
||
try {
|
||
$db = Database::getInstance();
|
||
$aboutPage = $db->getPage('about');
|
||
$rawContent = $aboutPage ? $aboutPage['content'] : '';
|
||
// Use static fallback if content is placeholder
|
||
if (empty(trim($rawContent)) || trim($rawContent) === 'Contenu à venir') {
|
||
$rawContent = APROPOS_STATIC_CONTENT;
|
||
}
|
||
} catch (Exception $e) {
|
||
error_log("Error loading about page: " . $e->getMessage());
|
||
$rawContent = APROPOS_STATIC_CONTENT;
|
||
}
|
||
|
||
$pd = new Parsedown();
|
||
$pd->setSafeMode(true);
|
||
$aboutHtml = $pd->text($rawContent);
|
||
$pageTitle = 'À Propos – Posterg';
|
||
$extraCss = ['assets/apropos.css'];
|
||
?>
|
||
<?php include APP_ROOT . '/templates/public/head.php'; ?>
|
||
<body class="apropos-body">
|
||
<a href="#main-content" class="skip-link">Aller au contenu principal</a>
|
||
|
||
<?php include APP_ROOT . '/templates/nav.php'; ?>
|
||
<?php include APP_ROOT . '/templates/search-bar.php'; ?>
|
||
|
||
<main class="apropos-main" id="main-content">
|
||
<div class="apropos-layout">
|
||
|
||
<!-- LEFT: main text (from DB, Markdown-rendered) -->
|
||
<div class="apropos-left">
|
||
<div class="apropos-description apropos-page-content">
|
||
<?= $aboutHtml ?>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- RIGHT: links, contacts, credits -->
|
||
<div class="apropos-right">
|
||
|
||
<div>
|
||
<h2 class="apropos-section-title">
|
||
<a href="https://erg.be" target="_blank" rel="noopener">Site de l'erg</a>
|
||
</h2>
|
||
</div>
|
||
|
||
<div>
|
||
<h2 class="apropos-section-title">Contacts</h2>
|
||
|
||
<div class="apropos-contact">
|
||
<span class="apropos-contact-name">Laurent Leprince</span>
|
||
<span class="apropos-contact-role">Bibliothèque d'architecture, d'ingénierie architecturale, d'urbanisme (BAIU) :</span>
|
||
<span class="apropos-contact-email">laurent.leprince@uclouvain.be</span>
|
||
</div>
|
||
|
||
<div class="apropos-contact">
|
||
<span class="apropos-contact-name">Xavier Gorgol</span>
|
||
<span class="apropos-contact-role">Responsable des mémoires de l'ERG :</span>
|
||
<span class="apropos-contact-email">xavier.gorgol@erg.be</span>
|
||
</div>
|
||
|
||
<div class="apropos-contact">
|
||
<span class="apropos-contact-name">Brigitte Ledune</span>
|
||
<span class="apropos-contact-role">Cours de suivi de mémoire :</span>
|
||
<span class="apropos-contact-email">brigitte.ledune@erg.be</span>
|
||
</div>
|
||
</div>
|
||
|
||
<div>
|
||
<h2 class="apropos-section-title">Crédits</h2>
|
||
<p class="apropos-credits-text">
|
||
Design & développement : Olivia Marly, Théophile Gerveau-Mercie & Théo Hennequin
|
||
</p>
|
||
<p class="apropos-credits-text">
|
||
Typographies : Ductus (Amélie Dumont) & BBB DM Sans
|
||
</p>
|
||
</div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</main>
|
||
|
||
</body>
|
||
</html>
|