mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
Replace span with a link + href in about.php for credits
This commit is contained in:
@@ -3,25 +3,34 @@
|
||||
* Render a comma-separated list of entries with links.
|
||||
* Entries joined with comma, last two joined with " & ".
|
||||
*/
|
||||
function renderEntries(array $entries): string {
|
||||
if (empty($entries)) return '';
|
||||
function renderEntries(array $entries): string
|
||||
{
|
||||
if (empty($entries)) {
|
||||
return "";
|
||||
}
|
||||
$parts = [];
|
||||
foreach ($entries as $e) {
|
||||
$text = htmlspecialchars($e['text'] ?? '');
|
||||
$url = $e['url'] ?? '';
|
||||
$text = htmlspecialchars($e["text"] ?? "");
|
||||
$url = $e["url"] ?? "";
|
||||
if (!empty($url)) {
|
||||
$parts[] = '<span class="apropos-entry"><a href="' . htmlspecialchars($url) . '" target="_blank" rel="noopener">' . $text . '</a></span>';
|
||||
$parts[] =
|
||||
'<span class="apropos-entry"><a href="' .
|
||||
htmlspecialchars($url) .
|
||||
'" target="_blank" rel="noopener">' .
|
||||
$text .
|
||||
"</a></span>";
|
||||
} else {
|
||||
$parts[] = '<span class="apropos-entry">' . $text . '</span>';
|
||||
$parts[] = '<span class="apropos-entry">' . $text . "</span>";
|
||||
}
|
||||
}
|
||||
$count = count($parts);
|
||||
if ($count === 1) return $parts[0];
|
||||
$prefix = implode(', ', array_slice($parts, 0, $count - 2));
|
||||
$suffix = implode(' & ', array_slice($parts, -2));
|
||||
return $prefix !== '' ? $prefix . ', ' . $suffix : $suffix;
|
||||
}
|
||||
?>
|
||||
if ($count === 1) {
|
||||
return $parts[0];
|
||||
}
|
||||
$prefix = implode(", ", array_slice($parts, 0, $count - 2));
|
||||
$suffix = implode(" & ", array_slice($parts, -2));
|
||||
return $prefix !== "" ? $prefix . ", " . $suffix : $suffix;
|
||||
} ?>
|
||||
<main class="apropos-main" id="main-content">
|
||||
<div class="apropos-layout">
|
||||
|
||||
@@ -64,16 +73,21 @@ function renderEntries(array $entries): string {
|
||||
<div class="apropos-contacts-grid">
|
||||
<?php foreach ($contacts as $group): ?>
|
||||
<address class="apropos-contact-card">
|
||||
<?= renderEntries($group['entries'] ?? []) ?>
|
||||
<?php if (!empty($group['role'])): ?>
|
||||
<span><?= htmlspecialchars($group['role']) ?></span>
|
||||
<?= renderEntries($group["entries"] ?? []) ?>
|
||||
<?php if (!empty($group["role"])): ?>
|
||||
<span><?= htmlspecialchars($group["role"]) ?></span>
|
||||
<?php endif; ?>
|
||||
<?php
|
||||
$emails = array_filter(array_column($group['entries'] ?? [], 'email'), fn($e) => !empty($e));
|
||||
foreach ($emails as $email):
|
||||
$emails = array_filter(
|
||||
array_column($group["entries"] ?? [], "email"),
|
||||
fn($e) => !empty($e),
|
||||
);
|
||||
foreach ($emails as $email): ?>
|
||||
<a href="mailto:<?= htmlspecialchars(
|
||||
$email,
|
||||
) ?>"><?= htmlspecialchars($email) ?></a>
|
||||
<?php endforeach;
|
||||
?>
|
||||
<a href="mailto:<?= htmlspecialchars($email) ?>"><?= htmlspecialchars($email) ?></a>
|
||||
<?php endforeach; ?>
|
||||
</address>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
@@ -87,16 +101,16 @@ function renderEntries(array $entries): string {
|
||||
<div class="apropos-credit-row">
|
||||
<dt>Design & développement</dt>
|
||||
<dd>
|
||||
<span class="apropos-entry">Olivia Marly</span>,
|
||||
<span class="apropos-entry">Théophile Gerveau-Mercie</span> &
|
||||
<span class="apropos-entry">Théo Hennequin</span>
|
||||
<a class="apropos-entry" target="_blank" href='mailto:oli98marly@gmail.com
'>Olivia Marly</a>,
|
||||
<a class="apropos-entry" target="_blank" href='https://tgm.happyngreen.fr'>Théophile Gerveau-Mercier</a> &
|
||||
<a class="apropos-entry" target="_blank" href='https://theohennequin.com'>Théo Hennequin</a>
|
||||
</dd>
|
||||
</div>
|
||||
<div class="apropos-credit-row">
|
||||
<dt>Typographies</dt>
|
||||
<dd>
|
||||
<span class="apropos-entry">Ductus (Amélie Dumont)</span> &
|
||||
<span class="apropos-entry">BBB DM Sans</span>
|
||||
<a class="apropos-entry" target="_blank" href='https://typotheque.genderfluid.space/fr/fontes/ductus'><b>Ductus</b> - Amélie Dumont</a> &
|
||||
<a class="apropos-entry" target="_blank" href='https://typotheque.genderfluid.space/fr/fontes/bbb-dm-sans'><b>BBB DM Sans</b> - Camille Circlude, Eugénie Bidaut, Mariel Nils, Bérénice Bouin</a>
|
||||
</dd>
|
||||
</div>
|
||||
</dl>
|
||||
|
||||
Reference in New Issue
Block a user