mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
formulaire: correctifs identifiant/année, contact, fichiers optionnels
- Identifiant: mise à jour automatique quand l'année change en back-office (updateThesis + ThesisEditController) - Contact: hint enrichi (1 seul contact, formatage Instagram/Mastodon) - Fichiers: TFE rendu optionnel pour Site web/Performance/Installation (note d'intention reste obligatoire)
This commit is contained in:
@@ -36,6 +36,10 @@ $selectedFormats = isset($_POST['formats']) && is_array($_POST['formats'])
|
||||
$adminMode = ($_POST['admin_mode'] ?? '0') === '1';
|
||||
$editMode = ($_POST['edit_mode'] ?? '0') === '1';
|
||||
|
||||
// TFE file is optional when format is Site web (3), Performance (4) or Installation (6)
|
||||
$noTfeFileFormats = [3, 4, 6];
|
||||
$tfeFileOptional = !empty(array_intersect($selectedFormats, $noTfeFileFormats));
|
||||
|
||||
$websiteUrl = htmlspecialchars($_POST['website_url'] ?? '');
|
||||
$websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
?>
|
||||
@@ -126,20 +130,20 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
|
||||
<!-- ── 3. TFE (all files: PDF, images, video, audio, VTT, archives) ── -->
|
||||
<div class="admin-form-group admin-files-fieldgroup">
|
||||
<label for="tfe-files-input">TFE<?= !$adminMode ? ' <span class="asterisk">*</span>' : '' ?></label>
|
||||
<label for="tfe-files-input">TFE<?= (!$adminMode && !$tfeFileOptional) ? ' <span class="asterisk">*</span>' : '' ?><?= $tfeFileOptional ? ' (optionnel pour ce format)' : '' ?></label>
|
||||
<div class="admin-file-input">
|
||||
<input type="file" id="tfe-files-input"
|
||||
name="queue_file[tfe][]"
|
||||
multiple
|
||||
class="tfe-file-picker"
|
||||
data-queue-type="tfe"
|
||||
<?= !$adminMode ? 'required' : '' ?>
|
||||
<?= (!$adminMode && !$tfeFileOptional) ? 'required' : '' ?>
|
||||
data-existing-files='<?= htmlspecialchars(json_encode($existingFilesJsonForTfe ?? []), ENT_QUOTES) ?>'>
|
||||
<small class="admin-file-hint">
|
||||
Glissez pour réordonner.
|
||||
<br>
|
||||
<br>
|
||||
PDF (max 100 MB) · Images (max 500 MB) · Vidéo & Audio (max 2 GB) · VTT · Archives (max 500 MB).
|
||||
PDF (max 100 MB) · Images (max 1 GB) · Vidéo & Audio (max 8 GB) · VTT · Archives (max 1 GB).
|
||||
<br>→ PDFs trop lourds ? <a href="https://www.bentopdf.com" target="_blank" rel="noopener">https://bentopdf.com/</a>
|
||||
<?php if ($peerTubeEnabled): ?>
|
||||
<br><br>Vidéos et audio hébergés sur <a href="<?= htmlspecialchars($peerTubeSettings['instance_url']) ?>" target="_blank" rel="noopener">PeerTube</a>.
|
||||
@@ -172,7 +176,7 @@ $websiteLabel = htmlspecialchars($_POST['website_label'] ?? '');
|
||||
class="tfe-file-picker"
|
||||
data-queue-type="annexe"
|
||||
data-existing-files='<?= htmlspecialchars(json_encode($existingFilesJsonForAnnexe ?? []), ENT_QUOTES) ?>'>
|
||||
<small class="admin-file-hint">PDF ou archives ZIP/TAR. Max 500 MB. Glissez pour réordonner.</small>
|
||||
<small class="admin-file-hint">PDF ou archives ZIP/TAR. Max 1 GB. Glissez pour réordonner.</small>
|
||||
</div>
|
||||
<?php if ($editMode): ?>
|
||||
<button type="button" class="btn btn--sm btn--ghost file-browser-trigger"
|
||||
|
||||
@@ -43,7 +43,7 @@ $adminMode = $adminMode ?? false;
|
||||
class="tfe-file-picker"
|
||||
data-queue-type="tfe">
|
||||
<small class="admin-file-hint">
|
||||
Types acceptés : PDF · JPG/PNG/GIF/WEBP · MP4/WebM/MOV (vidéo) · MP3/OGG/WAV/FLAC (audio) · ZIP/TAR (archives). Max 500 MB par fichier.
|
||||
Types acceptés : PDF · JPG/PNG/GIF/WEBP · MP4/WebM/MOV (vidéo) · MP3/OGG/WAV/FLAC (audio) · ZIP/TAR (archives). Max 1 GB par fichier.
|
||||
Les fichiers <code>.vtt</code> sont des sous-titres et seront associés automatiquement à la vidéo précédente.
|
||||
</small>
|
||||
</div>
|
||||
|
||||
@@ -61,7 +61,7 @@ $adminMode = $adminMode ?? false;
|
||||
<?php
|
||||
$name = 'mail'; $label = 'Contact visible (optionnel) [mail/site/insta/etc.] :'; $value = $oldFn('mail');
|
||||
$attrs = ['autocomplete' => 'email'];
|
||||
$hint = 'Ce contact sera visible publiquement sur la fiche du TFE.';
|
||||
$hint = 'Un seul contact. Indiquez l\'URL complète pour un site (https://…), l\'adresse mail, le nom d\'utilisateur avec @ pour Instagram (@pseudo), ou l\'adresse complète pour Mastodon (@pseudo@instance). Ce contact sera visible publiquement sur la fiche du TFE.';
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user