feat: require 3 mots-clés in partage, language asterisk toggle, admin auto-save checkboxes

- tag-search: add minTags/required params, counter shows red if < 3, accent if ≥ 3
- form.php: pass minTags=3 for partage mode keywords
- checkbox-list: support labelHtml for raw HTML label with targetable asterisk span
- language-autre-fragment: OOB swap updates #languages-required-asterisk when autre pills change
- language-search: client-side update #languages-required-asterisk on pill add/remove
- contenus.php: replace 3 form+submit-button fieldsets with HTMX auto-save checkboxes
- settings.php: detect HX-Request header, return OOB CSRF token updates, skip redirect
This commit is contained in:
Pontoporeia
2026-05-10 23:49:43 +02:00
parent 48da914bc8
commit cf9bd5cd5d
12 changed files with 328 additions and 39 deletions

View File

@@ -9,7 +9,8 @@
*
* Variables consumed:
* string $name — input name attribute (will be posted as array: name[])
* string $label — group label text
* string $label — group label text (htmlspecialchars'd unless $labelHtml is set)
* string $labelHtml — raw HTML label override (bypasses htmlspecialchars, optional)
* array $options — each element must have 'id' and 'name' keys
* array $checked — array of 'id' values that are currently checked
* bool $required — whether at least one checkbox must be checked; default false
@@ -27,7 +28,7 @@ $hxSwap = $hxSwap ?? 'outerHTML';
$hxInclude = $hxInclude ?? 'this';
?>
<div>
<span class="admin-row-label"><?= htmlspecialchars($label) ?><?= $required ? ' <span class="asterisk">*</span>' : '' ?></span>
<span class="admin-row-label"><?= isset($labelHtml) ? $labelHtml : (htmlspecialchars($label) . ($required ? ' <span class="asterisk">*</span>' : '')) ?></span>
<fieldset class="admin-checkbox-group"
<?= $required ? ' required aria-required="true"' : '' ?>
<?php if ($hxPost !== ''): ?>