forked from FWS/FWS-TEMPLATE-Website-OnePage
Root-absolute asset paths and ?p= links broke when the site is served from a subfolder (WAMP). Screenshots from the database and avatars from creators.json go through fws_url() as well.
70 lines
2.6 KiB
PHP
70 lines
2.6 KiB
PHP
<?php
|
|
/**
|
|
* FWS Linux — page Équipe (rendu serveur depuis p/equipe/creators.json).
|
|
* Remplace creators-loader.js.
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
if (!defined('FWS_PAGE_SHELL')) {
|
|
/* Accès direct (/p/equipe/…) : on délègue au front controller. */
|
|
require __DIR__ . '/../../page.php';
|
|
exit;
|
|
}
|
|
|
|
$title = "L'équipe | FWS Linux";
|
|
$description = 'Découvrez les contributeurs de FWS Linux — l\'équipe qui développe et maintient cette distribution open-source.';
|
|
$extraCss[] = fws_url('/p/assets/styles/equipe.css');
|
|
$extraCss[] = fws_url('/p/assets/styles/creators.css');
|
|
|
|
$creators = [];
|
|
$file = dirname(__DIR__) . '/equipe/creators.json';
|
|
if (is_file($file)) {
|
|
$data = json_decode((string) file_get_contents($file), true);
|
|
if (is_array($data)) {
|
|
$creators = fws_utf8_arr($data);
|
|
}
|
|
}
|
|
?>
|
|
<section class="equipe-hero">
|
|
<h1>L'équipe</h1>
|
|
<p>Les personnes qui contribuent au projet FWS Linux.</p>
|
|
</section>
|
|
|
|
<section class="equipe-grid-section" aria-label="Liste des contributeurs">
|
|
<?php if ($creators === []): ?>
|
|
<p class="creators-error">Impossible de charger les données des créateurs.</p>
|
|
<?php else: ?>
|
|
<div class="creators-grid">
|
|
<?php foreach ($creators as $creator): ?>
|
|
<article class="creator-card">
|
|
<?php if (!empty($creator['avatar'])): ?>
|
|
<img class="creator-avatar" src="<?= e(fws_url((string) $creator['avatar'])) ?>" alt="<?= e((string) ($creator['name'] ?? $creator['role'] ?? '')) ?>" loading="lazy">
|
|
<?php endif; ?>
|
|
<div class="creator-info">
|
|
<?php if (!empty($creator['name'])): ?>
|
|
<h3 class="creator-name"><?= e((string) $creator['name']) ?></h3>
|
|
<?php endif; ?>
|
|
<?php if (!empty($creator['role'])): ?>
|
|
<span class="creator-role"><?= e((string) $creator['role']) ?></span>
|
|
<?php endif; ?>
|
|
<?php if (!empty($creator['joined'])): ?>
|
|
<span class="creator-joined">A rejoint le <?= e(fws_format_date((string) $creator['joined'])) ?></span>
|
|
<?php endif; ?>
|
|
<?php if (!empty($creator['email'])): ?>
|
|
<a class="creator-email" href="mailto:<?= e((string) $creator['email']) ?>"><?= e((string) $creator['email']) ?></a>
|
|
<?php endif; ?>
|
|
<?php if (!empty($creator['links'])): ?>
|
|
<div class="creator-links">
|
|
<?php foreach ($creator['links'] as $link): ?>
|
|
<a class="creator-link" href="<?= e((string) ($link['url'] ?? '')) ?>" target="_blank" rel="noopener noreferrer"><?= e((string) ($link['label'] ?? '') !== '' ? (string) $link['label'] : (string) ($link['url'] ?? '')) ?></a>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</div>
|
|
</article>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<?php endif; ?>
|
|
</section>
|