mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
refactor form structure per new spec + fix
- split jury into interne/externe/ULB, - remove president from student form, - add language_autre, - split duration into pages+minutes+annexes, - move licence to degrés d'ouverture with CC2r, - add license_custom, - filter PACS from student AP list, - editable généralités help block, - Libre toggle per settings Fix: - missing comma after cc4r column in schema.sql - remove duplicate form footer from partage template - remove couverture from student files fieldset; add promoteur ULB conditional disable via JS on Approfondi - promoteur ULB: remove 'si applicable', make required when visible
This commit is contained in:
@@ -6,14 +6,11 @@
|
||||
* callable|null $oldFn — callable($key, $default='') to retrieve old/current values;
|
||||
* defaults to the global old() function when null.
|
||||
* callable|null $withAutofocusFn — callable($field, $attrs=[]) to inject autofocus;
|
||||
* defaults to identity (returns $attrs) when null.
|
||||
* defaults to identity when null.
|
||||
* array $allowedObjet — list of allowed objet values; when count > 1 a radio group
|
||||
* is shown; when count === 1 a hidden input is emitted instead.
|
||||
* Omit or pass [] to suppress the objet selector entirely.
|
||||
* array $formData — raw form data array (used for contact_public checkbox state).
|
||||
* string $synopsisExtra — optional HTML block injected after the synopsis label
|
||||
* (use for student-facing explanations).
|
||||
* bool $isAdminMode — when true the form uses admin-style helpers; default false.
|
||||
* array $formData — raw form data array (used for checkbox states).
|
||||
* string $synopsisExtra — optional HTML block injected after the synopsis label.
|
||||
*/
|
||||
|
||||
$oldFn = $oldFn ?? (function_exists('old') ? 'old' : fn($k, $d = '') => $d);
|
||||
@@ -45,37 +42,29 @@ $synopsisExtra = $synopsisExtra ?? '';
|
||||
<?php endif; ?>
|
||||
|
||||
<?php
|
||||
$name = 'titre'; $label = 'Titre :'; $value = $oldFn('titre'); $required = true;
|
||||
$name = 'titre'; $label = 'Titre du TFE :'; $value = $oldFn('titre'); $required = true;
|
||||
$attrs = $withAutofocusFn('titre');
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
<?php
|
||||
$name = 'subtitle'; $label = 'Sous-titre (si applicable) :'; $value = $oldFn('subtitle'); $required = false;
|
||||
$attrs = [];
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
<?php
|
||||
$name = 'auteurice'; $label = 'Auteur·ice(s) :'; $value = $oldFn('auteurice'); $required = true;
|
||||
$attrs = $withAutofocusFn('auteurice', ['autocomplete' => 'name']);
|
||||
$hint = 'Séparez les auteur·ices par des virgules.';
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
<?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.';
|
||||
include APP_ROOT . '/templates/partials/form/text-field.php';
|
||||
?>
|
||||
|
||||
<div class="admin-form-group">
|
||||
<label class="admin-checkbox-label">
|
||||
<input type="checkbox" name="contact_public" value="1"
|
||||
<?= !empty($formData['contact_public']) ? 'checked' : '' ?>>
|
||||
Rendre mon contact visible publiquement sur la fiche du TFE
|
||||
</label>
|
||||
<small>Si coché, votre contact apparaîtra sur la page publique. L'adresse est toujours conservée en interne.</small>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label for="synopsis">Synopsis :</label>
|
||||
<label for="synopsis">Synopsis : <span class="asterisk">*</span></label>
|
||||
<?= $synopsisExtra ?>
|
||||
<textarea id="synopsis" name="synopsis" rows="7" required
|
||||
<?= ($withAutofocusFn('synopsis')['autofocus'] ?? false) ? 'autofocus' : '' ?>><?= $oldFn('synopsis') ?></textarea>
|
||||
|
||||
Reference in New Issue
Block a user