mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
113 lines
4.8 KiB
PHP
113 lines
4.8 KiB
PHP
<?php
|
||
require_once __DIR__ . '/../config/bootstrap.php';
|
||
require_once APP_ROOT . '/src/Database.php';
|
||
require_once APP_ROOT . '/src/Parsedown.php';
|
||
|
||
$apropos = require APP_ROOT . '/config/apropos.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';
|
||
$metaDescription = 'À propos de Posterg, le répertoire des mémoires de fin d\'études de l\'erg – École de Recherches Graphiques de Bruxelles.';
|
||
$ogTags = [
|
||
'type' => 'website',
|
||
'title' => $pageTitle,
|
||
'description' => $metaDescription,
|
||
'url' => 'https://posterg.erg.be/apropos.php',
|
||
'site_name' => 'Posterg – ERG',
|
||
];
|
||
$extraCss = ['/assets/css/apropos.css'];
|
||
$bodyClass = 'apropos-body';
|
||
?>
|
||
<?php include APP_ROOT . '/templates/head.php'; ?>
|
||
<?php include APP_ROOT . '/templates/header.php'; ?>
|
||
|
||
<main class="apropos-main" id="main-content">
|
||
<div class="apropos-layout">
|
||
|
||
<!-- LEFT: sticky table of contents -->
|
||
<nav class="apropos-toc" aria-label="Sections de la page">
|
||
<p class="apropos-toc-label">Parties</p>
|
||
<ul>
|
||
<li><a href="#apropos-intro">À propos</a></li>
|
||
<?php if (!empty($apropos['contacts'])): ?>
|
||
<li><a href="#apropos-contacts">Contacts</a></li>
|
||
<?php endif; ?>
|
||
<?php if (!empty($apropos['credits'])): ?>
|
||
<li><a href="#apropos-credits">Crédits</a></li>
|
||
<?php endif; ?>
|
||
</ul>
|
||
<div class="apropos-toc-erg">
|
||
<a href="<?= htmlspecialchars($apropos['erg_url']) ?>" target="_blank" rel="noopener">
|
||
Site de l'erg ↗
|
||
</a>
|
||
</div>
|
||
</nav>
|
||
|
||
<!-- MIDDLE: main prose + sections -->
|
||
<div class="apropos-content">
|
||
|
||
<!-- Intro text from DB -->
|
||
<section class="apropos-section" id="apropos-intro">
|
||
<div class="prose">
|
||
<?= $aboutHtml ?>
|
||
</div>
|
||
</section>
|
||
|
||
<?php if (!empty($apropos['contacts'])): ?>
|
||
<!-- Contacts section -->
|
||
<section class="apropos-section" id="apropos-contacts">
|
||
<h2 class="apropos-section-title">Contacts</h2>
|
||
<div class="apropos-contacts-grid">
|
||
<?php foreach ($apropos['contacts'] as $contact): ?>
|
||
<address class="apropos-contact-card">
|
||
<strong><?= htmlspecialchars($contact['name']) ?></strong>
|
||
<span><?= htmlspecialchars($contact['role']) ?></span>
|
||
<a href="mailto:<?= htmlspecialchars($contact['email']) ?>"><?= htmlspecialchars($contact['email']) ?></a>
|
||
</address>
|
||
<?php endforeach; ?>
|
||
</div>
|
||
</section>
|
||
<?php endif; ?>
|
||
|
||
<?php if (!empty($apropos['credits'])): ?>
|
||
<!-- Credits section -->
|
||
<section class="apropos-section" id="apropos-credits">
|
||
<h2 class="apropos-section-title">Crédits</h2>
|
||
<dl class="apropos-credits-list">
|
||
<?php foreach ($apropos['credits'] as $credit): ?>
|
||
<div class="apropos-credit-row">
|
||
<dt><?= htmlspecialchars($credit['label']) ?></dt>
|
||
<dd><?= htmlspecialchars($credit['value']) ?></dd>
|
||
</div>
|
||
<?php endforeach; ?>
|
||
</dl>
|
||
</section>
|
||
<?php endif; ?>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</main>
|
||
|
||
<?php include APP_ROOT . '/templates/footer.php'; ?>
|