feat: add FilePond pools for couverture, note_intention, video, audio; refactor queue config

This commit is contained in:
Pontoporeia
2026-05-10 20:33:29 +02:00
parent ecb559a18a
commit 7b5f3efe40
4 changed files with 81 additions and 48 deletions

View File

@@ -197,36 +197,35 @@ $hasAnnexesChecked = !empty($_POST['has_annexes']);
</div>
<?php endif; ?>
<!-- ── 1. Couverture (always) ── -->
<div>
<!-- ── 1. Couverture (always, FilePond single-file) ── -->
<?php
$_cover = $_POST['_cover'] ?? null;
// Only show upload field in add mode or when no existing cover
if (!$editMode || !$_cover):
$name = 'couverture';
$label = 'Image de couverture (optionnel)';
$accept = 'image/jpeg,image/png,image/webp';
$hint = 'JPG, PNG ou WEBP. Format 4:3 recommandé. Max 20 MB.';
$required = false;
$id = 'couverture';
include APP_ROOT . '/templates/partials/form/file-field.php';
endif;
unset($_cover);
?>
if (!$editMode || !$_cover): ?>
<div class="admin-form-group">
<label for="couverture">Image de couverture (optionnel)</label>
<div class="admin-file-input">
<input type="file" id="couverture"
name="couverture"
accept="image/jpeg,image/png,image/webp"
class="tfe-file-picker tfe-file-picker--single"
data-queue-type="cover">
<small>JPG, PNG ou WEBP. Format 4:3 recommandé. Max 20 MB.</small>
</div>
</div>
<?php endif; unset($_cover); ?>
<!-- ── 2. Note d'intention (always) ── -->
<div>
<?php
$name = 'note_intention';
$label = 'Note d\'intention';
$accept = '.pdf';
$hint = 'PDF uniquement. Max 100 MB. Si votre fichier est trop lourd, compressez-le avec <a href="https://www.bentopdf.com" target="_blank" rel="noopener">bentopdf.com</a>.';
$hintRaw = true;
$required = !$adminMode;
$id = 'note_intention';
include APP_ROOT . '/templates/partials/form/file-field.php';
?>
<!-- ── 2. Note d'intention (always, FilePond single-file) ── -->
<div class="admin-form-group">
<label for="note_intention">Note d'intention<?= !$adminMode ? ' <span class="asterisk">*</span>' : '' ?></label>
<div class="admin-file-input">
<input type="file" id="note_intention"
name="note_intention"
accept=".pdf"
class="tfe-file-picker tfe-file-picker--single"
data-queue-type="note_intention"
<?= !$adminMode ? 'required' : '' ?>>
<small>PDF uniquement. Max 100 MB. Si votre fichier est trop lourd, compressez-le avec <a href="https://www.bentopdf.com" target="_blank" rel="noopener">bentopdf.com</a>.</small>
</div>
</div>
<!-- ── 3. TFE — multi-file upload (FilePond) ── -->