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

@@ -31,7 +31,6 @@
* bool $showContact — Contact checkbox fieldset
* bool $showCoverPreview — cover image preview + remove checkbox
* bool $showExistingFiles — existing thesis files list (sortable, deletable)
* bool $showBannerPreview — banner image preview + remove checkbox
* bool $showContextNote — Note contextuelle fieldset
* bool $showBackoffice — Backoffice fieldset (jury_points, remarks, contact_interne, exemplaires)
* bool $showEmailConfirmation — E-mail de confirmation fieldset
@@ -44,7 +43,6 @@
* string $filesMode — 'add' | 'edit' (determines which file inputs to show)
* ?string $currentCover — existing cover file info for edit mode
* array $currentFiles — existing thesis files for edit mode
* ?string $currentBannerPath — existing banner path for edit mode
* ?string $currentContextNote — existing context note for edit mode
* array $currentRaw — raw thesis row for edit mode
* ?string $currentAuthorShowContact — author show_contact flag for edit mode
@@ -84,7 +82,7 @@ $showFlash = $showFlash ?? false;
$showContact = $showContact ?? false;
$showCoverPreview = $showCoverPreview ?? false;
$showExistingFiles = $showExistingFiles ?? false;
$showBannerPreview = $showBannerPreview ?? false;
$showBannerPreview = false; // Banners merged into covers — field removed
$showContextNote = $showContextNote ?? false;
$showBackoffice = $showBackoffice ?? false;
$showEmailConfirmation = $showEmailConfirmation ?? false;
@@ -249,11 +247,11 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
</label>
</div>
<?php endif; ?>
<input type="file" id="couverture" name="couverture" accept="image/jpeg,image/png" data-preview="fp-couverture">
<input type="file" id="couverture" name="couverture" accept="image/jpeg,image/png,image/webp" data-preview="fp-couverture">
<div id="fp-couverture" class="file-preview-list" aria-live="polite"></div>
<small><?= empty($currentCover)
? "JPG, PNG. Format 4:3 recommandé. Max 20 MB."
: "Laisser vide pour conserver la couverture actuelle. JPG, PNG. Max 20 MB." ?></small>
? "JPG, PNG ou WEBP. Format 4:3 recommandé. Max 20 MB."
: "Laisser vide pour conserver la couverture actuelle. JPG, PNG ou WEBP. Max 20 MB." ?></small>
</div>
</div>
@@ -377,27 +375,7 @@ $checkedFormatsForSiteWeb = $checkedFormatsForSiteWeb ?? [];
</div>
</div>
<!-- Banner image -->
<div class="admin-form-group">
<label>Image bannière (accueil) :</label>
<div class="admin-file-input">
<?php if (!empty($currentBannerPath)): ?>
<div class="admin-banner-preview">
<img src="/media.php?path=<?= urlencode(
$currentBannerPath,
) ?>" alt="Bannière actuelle">
<label class="admin-checkbox-label">
<input type="checkbox" name="remove_banner" value="1"> Supprimer la bannière
</label>
</div>
<?php endif; ?>
<input type="file" name="banner" id="banner" accept="image/jpeg,image/png,image/webp" data-preview="fp-banner">
<div id="fp-banner" class="file-preview-list" aria-live="polite"></div>
<small><?= empty($currentBannerPath)
? "JPG, PNG ou WEBP. Format paysage recommandé (4:1). Max 20 MB."
: "Laisser vide pour conserver la bannière actuelle. JPG, PNG ou WEBP. Format paysage recommandé (4:1). Max 20 MB." ?></small>
</div>
</div>
</fieldset>
<?php else: ?>
<?php