mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-05-06 19:19:19 +02:00
feat: extract MediaController, wire into Dispatcher, delete media.php
This commit is contained in:
49
app/templates/public/home.php
Normal file
49
app/templates/public/home.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php if ($year): ?>
|
||||
<p class="filter-info" role="status">
|
||||
Année : <?= htmlspecialchars($year) ?>
|
||||
<a href="?<?= http_build_query(array_diff_key($vars ?? [], ['page' => 1, 'year' => 1])) ?>" class="clear-filter"><span aria-hidden="true">✕</span> Réinitialiser</a>
|
||||
</p>
|
||||
<?php elseif ($isDefaultView): ?>
|
||||
<p class="home-section-label" role="status">Publication récente</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<main class="home-main" id="main-content">
|
||||
<h1 class="sr-only">Mémoires de l'ERG</h1>
|
||||
<ul class="cards-container">
|
||||
<?php foreach ($itemsToLoad as $item): ?>
|
||||
<li class="card">
|
||||
<a href="/tfe?id=<?= (int)$item["id"] ?>">
|
||||
<?php
|
||||
$thumb = null;
|
||||
if (!empty($item['banner_path'])) {
|
||||
$thumb = $item['banner_path'];
|
||||
}
|
||||
if (!$thumb && isset($coverMap[$item['id']])) {
|
||||
$thumb = $coverMap[$item['id']];
|
||||
}
|
||||
?>
|
||||
<?php if ($thumb): ?>
|
||||
<figure>
|
||||
<img src="/media.php?path=<?= urlencode($thumb) ?>"
|
||||
alt="Couverture — <?= htmlspecialchars($item['title']) ?> par <?= htmlspecialchars($item['authors'] ?? '') ?>"
|
||||
loading="lazy">
|
||||
</figure>
|
||||
<?php else: ?>
|
||||
<div class="card__media--gradient"
|
||||
aria-hidden="true">
|
||||
<span class="card__gradient-author"><?= htmlspecialchars($item['authors'] ?? '') ?></span>
|
||||
<span class="card__gradient-title"><?= htmlspecialchars($item['title']) ?></span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<p><?= htmlspecialchars($item["authors"] ?? '') ?><?php if (!empty($item['authors']) && !empty($item['title'])): ?> – <?php endif; ?><?= htmlspecialchars($item["title"]) ?><?php if (!empty($item['year'])): ?><span class="sr-only">, <?= (int)$item['year'] ?></span><?php endif; ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<?php if (empty($itemsToLoad)): ?>
|
||||
<li class="cards-empty">Aucun mémoire trouvé.</li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php include APP_ROOT . '/templates/partials/pagination.php'; ?>
|
||||
</main>
|
||||
Reference in New Issue
Block a user