Files
Pontoporeia 10df92b643 fix: load autosave-handler.js on about_page edit view, persist contact group deletion
Two fixes:

1. about_page edit was missing autosave-handler.js: the first if block
   (editType === 'page' || 'about_page') overrode $extraJs with only
   overtype.min.js, making the elseif that added autosave-handler.js
   unreachable for about_page. Added autosave-handler.js to the first
   block, removed dead 'about_page' from the elseif.

2. Deleting a contact group (Contacts 3/4/5) only removed the DOM
   element but never triggered htmx autosave. Dispatched a 'change'
   event on the form after removal+reindex so the hx-trigger fires.

Also expanded autosave-handler.js URL filter to accept apropos.php
so the status indicator (Enregistrement/Enregistré) works for contacts saves.
2026-07-05 14:14:13 +02:00

61 lines
2.1 KiB
PHP
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/**
* Shared partial — "Fichiers" fieldset (add / student submission mode).
*
* Order per spec:
* 1. Image de couverture (optionnel)
* 2. Note d'intention (obligatoire)
* 3. TFE (obligatoire)
* 4. Annexes éventuelles (optionnel)
*
* Variables consumed:
* bool $adminMode — when true, no field is required (admin add/edit mode).
*/
$adminMode = $adminMode ?? false;
?>
<fieldset>
<legend>Fichiers</legend>
<?php
$name = 'couverture';
$label = 'Image de couverture (optionnel) :';
$accept = 'image/jpeg,image/png,image/webp';
$hint = 'JPG, PNG ou WEBP. Format 4:3 recommandé (ex. 1200 × 900 px). Max 20 MB.';
include APP_ROOT . '/templates/partials/form/file-field.php';
?>
<?php
$name = 'note_intention';
$label = 'Note d\'intention :';
$accept ='.pdf';
$hint = 'Format PDF uniquement.';
$required = !$adminMode;
include APP_ROOT . '/templates/partials/form/file-field.php';
?>
<!-- TFE files — multi-file, FilePond-powered -->
<div class="admin-form-group admin-files-fieldgroup">
<label>TFE (obligatoire) :</label>
<div class="admin-file-input">
<input type="file" id="tfe-files-input"
name="queue_file[tfe][]" multiple
accept=".pdf,.jpg,.jpeg,.png,.gif,.webp,.mp4,.webm,.mov,.ogv,.mp3,.ogg,.oga,.wav,.flac,.aac,.m4a,.vtt"
class="tfe-file-picker"
data-queue-type="tfe">
<small class="admin-file-hint">
Types acceptés : PDF (max 100 MB) · JPG/PNG/GIF/WEBP (max 500 MB) · MP4/WebM/MOV (vidéo, max 5 GB) · MP3/OGG/WAV/FLAC (audio, max 5 GB) · ZIP/TAR (archives, max 500 MB).
Les fichiers <code>.vtt</code> sont des sous-titres et seront associés automatiquement à la vidéo précédente.
</small>
</div>
</div>
<?php
$name = 'annexes';
$label = 'Annexes éventuelles (optionnel) :';
$accept = '.pdf,.zip,.tar,.gz';
$hint = 'PDF ou archives ZIP/TAR.';
$multiple = true;
include APP_ROOT . '/templates/partials/form/file-field.php';
?>
</fieldset>