merge banners into covers: remove banner field, migrate files, add covers to search/home/repertoire cards

This commit is contained in:
Pontoporeia
2026-05-08 10:46:02 +02:00
parent e3896811c4
commit f3d9615562
15 changed files with 198 additions and 407 deletions

View File

@@ -3,8 +3,9 @@
* Partial: student popover preview card(s).
*
* Expected variables:
* $theses array rows from Database::getThesesByAuthorName()
* $name string student name
* $theses array rows from Database::getThesesByAuthorName()
* $name string student name
* $coverMap array<int,string> thesis_id => cover file_path
*/
foreach ($theses as $t):
@@ -20,8 +21,9 @@ foreach ($theses as $t):
]);
?>
<a href="/tfe?id=<?= (int)$t['id'] ?>" class="student-card">
<?php if (!empty($t['banner_path'])): ?>
<div class="student-card__banner" style="background-image:url('<?= htmlspecialchars($t['banner_path']) ?>')"></div>
<?php $cover = $coverMap[$t['id']] ?? null; ?>
<?php if ($cover): ?>
<div class="student-card__banner" style="background-image:url('/media?path=<?= urlencode($cover) ?>')"></div>
<?php else: ?>
<div class="student-card__banner student-card__banner--gradient">
<span class="student-card__gradient-author"><?= htmlspecialchars($t['authors'] ?? '') ?></span>