Files
xamxam/public/apropos.php
Pontoporeia 18197bd468 Extract shared public <head> partial
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).
2026-03-28 16:49:09 +01:00

95 lines
3.9 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.
<?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 &amp; développement : Olivia Marly, Théophile Gerveau-Mercie &amp; Théo Hennequin
</p>
<p class="apropos-credits-text">
Typographies : Ductus (Amélie Dumont) &amp; BBB DM Sans
</p>
</div>
</div>
</div>
</main>
</body>
</html>