mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
Extract apropos contacts/credits to config/apropos.php
Names, roles, emails, and credits on the À propos page were hardcoded directly in apropos.php HTML. To update a contact meant editing a template file — risky for non-developers and easy to introduce a typo or broken mailto link. Changes: - config/apropos.php: new config array with erg_url, contacts[] (name, role, email per person) and credits[] (label/value pairs); follows the same pattern as config/admin_credentials.php - public/apropos.php: loads config via require; aside section now loops over $apropos['contacts'] and $apropos['credits'] with htmlspecialchars throughout; hardcoded HTML strings removed entirely Also audited todo/02-php-components.md and marked 8 stale items as done: all 5 form field partials were already implemented and in use, the flash-message consolidation was already handled by App::consumeFlash(), and the RateLimit cache dir was already at storage/cache/rate_limit (excluded from deploy rsync).
This commit is contained in:
@@ -3,6 +3,8 @@ 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
|
||||
@@ -47,46 +49,39 @@ $bodyClass = 'apropos-body';
|
||||
<?= $aboutHtml ?>
|
||||
</div>
|
||||
|
||||
<!-- RIGHT: links, contacts, credits -->
|
||||
<!-- RIGHT: links, contacts, credits (data from config/apropos.php) -->
|
||||
<aside class="apropos-aside">
|
||||
|
||||
<section>
|
||||
<h2 class="apropos-section-title">
|
||||
<a href="https://erg.be" target="_blank" rel="noopener">Site de l'erg</a>
|
||||
<a href="<?= htmlspecialchars($apropos['erg_url']) ?>" target="_blank" rel="noopener">Site de l'erg</a>
|
||||
</h2>
|
||||
</section>
|
||||
|
||||
<?php if (!empty($apropos['contacts'])): ?>
|
||||
<section>
|
||||
<h2 class="apropos-section-title">Contacts</h2>
|
||||
|
||||
<?php foreach ($apropos['contacts'] as $contact): ?>
|
||||
<address>
|
||||
<strong>Laurent Leprince</strong>
|
||||
<span>Bibliothèque d'architecture, d'ingénierie architecturale, d'urbanisme (BAIU) :</span>
|
||||
<a href="mailto:laurent.leprince@uclouvain.be">laurent.leprince@uclouvain.be</a>
|
||||
</address>
|
||||
|
||||
<address>
|
||||
<strong>Xavier Gorgol</strong>
|
||||
<span>Responsable des mémoires de l'ERG :</span>
|
||||
<a href="mailto:xavier.gorgol@erg.be">xavier.gorgol@erg.be</a>
|
||||
</address>
|
||||
|
||||
<address>
|
||||
<strong>Brigitte Ledune</strong>
|
||||
<span>Cours de suivi de mémoire :</span>
|
||||
<a href="mailto:brigitte.ledune@erg.be">brigitte.ledune@erg.be</a>
|
||||
<strong><?= htmlspecialchars($contact['name']) ?></strong>
|
||||
<span><?= htmlspecialchars($contact['role']) ?></span>
|
||||
<a href="mailto:<?= htmlspecialchars($contact['email']) ?>"><?= htmlspecialchars($contact['email']) ?></a>
|
||||
</address>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!empty($apropos['credits'])): ?>
|
||||
<section>
|
||||
<h2 class="apropos-section-title">Crédits</h2>
|
||||
<?php foreach ($apropos['credits'] as $credit): ?>
|
||||
<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
|
||||
<?= htmlspecialchars($credit['label']) ?> : <?= htmlspecialchars($credit['value']) ?>
|
||||
</p>
|
||||
<?php endforeach; ?>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
</aside>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user