feat: convert all file inputs to FilePond for standardized uploading

- Add csv_import queue type (storeAsFile, no async upload) for CSV import dialog
- Convert file-field.php partial to FilePond with field-name→queue-type mapping
- Conditionally skip server config for storeAsFile queues in buildFilePondOptions
- Skip FilePond init for inputs inside closed <dialog> elements
- Trigger FilePond init when import dialog opens
- Load FilePond CSS/JS assets on admin index page
This commit is contained in:
Pontoporeia
2026-06-08 10:28:39 +02:00
parent fad38f4e0d
commit df70fba5d4
8 changed files with 1089 additions and 41 deletions

View File

@@ -46,7 +46,7 @@ document.addEventListener('htmx:afterSwap',()=>{document.querySelectorAll('input
</button>
<?php endif; ?>
<button type="button" class="btn btn--primary btn--sm" id="import-dialog-btn"
onclick="document.getElementById('import-dialog').showModal()">
onclick="document.getElementById('import-dialog').showModal(); window.XamxamInitFilePonds()">
Importer
</button>
</div>
@@ -214,7 +214,11 @@ document.addEventListener('htmx:afterSwap',()=>{document.querySelectorAll('input
<div>
<label for="csv_file">Fichier CSV</label>
<div class="admin-file-input">
<input type="file" id="csv_file" name="csv_file" accept=".csv" required>
<input type="file" id="csv_file"
name="csv_file"
class="tfe-file-picker"
data-queue-type="csv_import"
required>
<small class="admin-file-hint">
Colonnes : Identifiant, Titre, Sous-titre, Auteur·ice(s), Contact, Promoteur·ice(s), Format, Année, AP, Orientation, Finalité, Mots-clés, Synopsis, Contexte, Remarques, Langue, Autorisation, License, taille, Points sur 20, lien BAIU<br>
Quatre premières lignes ignorées — Séparateur : virgule — UTF-8