diff --git a/TODO.md b/TODO.md index 1388498..1b809be 100644 --- a/TODO.md +++ b/TODO.md @@ -40,7 +40,7 @@ PHP has no component system, but `include`/`require` with variable scoping works - [ ] **`select-field.php`** — accepts `$name`, `$label`, `$options[]`, `$selected`, `$required`; renders `
- - -
- -
- - -
-
- - -
- -
- -
- - - -
-
- -
- - +
diff --git a/public/admin/edit.php b/public/admin/edit.php index 9a4e8f9..d5b753b 100644 --- a/public/admin/edit.php +++ b/public/admin/edit.php @@ -148,77 +148,7 @@ try { } } ?> -
- Composition du jury - -
- - -
- -
- -
- - -
-
- -
- -
-
- -
- - - -
- - $lm): ?> -
- - - -
- - -
- -
-
-
- +
diff --git a/templates/partials/form/jury-fieldset.php b/templates/partials/form/jury-fieldset.php new file mode 100644 index 0000000..bfc2eea --- /dev/null +++ b/templates/partials/form/jury-fieldset.php @@ -0,0 +1,107 @@ + string, 'is_external' => int] + * + * In "add" mode (no existing jury data), callers should pass nulls/empty arrays and + * may rely on the $formData repopulation helpers (old/wasSelected) defined in add.php. + * When those helpers exist and no explicit values are set, the partial uses them. + */ + +$juryPresident = $juryPresident ?? null; +$juryPromoteur = $juryPromoteur ?? null; +$juryPromoteurExt = $juryPromoteurExt ?? 0; +$juryLecteurs = $juryLecteurs ?? []; + +// In add-mode, repopulate from flash form data when helpers are available. +$addMode = ($juryPresident === null && $juryPromoteur === null && empty($juryLecteurs)); +if ($addMode && function_exists('old')) { + $juryPresident = old('jury_president') ?: null; + $juryPromoteur = old('jury_promoteur') ?: null; + $juryPromoteurExt = function_exists('wasSelected') && wasSelected('jury_promoteur_ext', '1') ? 1 : 0; +} + +$juryIdx = max(count($juryLecteurs), 1); +?> + +
+ Composition du jury + + +
+ + +
+ + +
+ +
+ + +
+
+ + +
+ +
+
+ +
+ + + +
+ + $lm): ?> +
+ + + +
+ + +
+ +
+
+
+