mirror of
https://codeberg.org/PostERG/xamxam.git
synced 2026-06-25 16:19:19 +02:00
fix: settings checkboxes — fix unchecked state handling, split into separate forms to avoid cross-resets, use HTMX auto-save with hidden value=0 inputs
This commit is contained in:
@@ -85,11 +85,12 @@
|
||||
<section aria-labelledby="form-settings-title">
|
||||
<h2 id="form-settings-title">Paramètres du Formulaire</h2>
|
||||
|
||||
<fieldset>
|
||||
<fieldset id="fieldset-restrictions">
|
||||
<legend>Restrictions d'accès aux fichiers</legend>
|
||||
|
||||
<div class="param-form" id="param-form-restrictions">
|
||||
<div class="param-form">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
||||
<input type="hidden" name="section" value="formulaire_restrictions">
|
||||
|
||||
<label class="param-checkbox">
|
||||
<input type="hidden" name="restricted_files_enabled" value="0">
|
||||
@@ -98,8 +99,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-restrictions"
|
||||
hx-vals='{"section":"formulaire"}'>
|
||||
hx-include="#fieldset-restrictions">
|
||||
<span>
|
||||
<strong>Activer la restriction d'accès</strong><br>
|
||||
<small>Pour les TFE de type "Interne", masquer les fichiers et exiger une demande d'accès par email. Les métadonnées et le résumé restent visibles publiquement.</small>
|
||||
@@ -108,12 +108,13 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<fieldset id="fieldset-acces">
|
||||
<legend>Degré d'ouverture</legend>
|
||||
<p>Options de visibilité disponibles dans le formulaire d'ajout de TFE.</p>
|
||||
|
||||
<div class="param-form" id="param-form-acces">
|
||||
<div class="param-form">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
||||
<input type="hidden" name="section" value="formulaire_acces">
|
||||
|
||||
<label class="param-checkbox">
|
||||
<input type="hidden" name="access_type_libre_enabled" value="0">
|
||||
@@ -122,8 +123,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-acces"
|
||||
hx-vals='{"section":"formulaire"}'>
|
||||
hx-include="#fieldset-acces">
|
||||
<span>
|
||||
<strong>Libre</strong><br>
|
||||
<small>Libre accès — TFE accessible publiquement sur la plateforme et en bibliothèque</small>
|
||||
@@ -137,8 +137,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-acces"
|
||||
hx-vals='{"section":"formulaire"}'>
|
||||
hx-include="#fieldset-acces">
|
||||
<span>
|
||||
<strong>Interne</strong><br>
|
||||
<small>TFE accessible uniquement sur place en physique</small>
|
||||
@@ -152,8 +151,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-acces"
|
||||
hx-vals='{"section":"formulaire"}'>
|
||||
hx-include="#fieldset-acces">
|
||||
<span>
|
||||
<strong>Interdit</strong><br>
|
||||
<small>TFE non disponible en physique ni sur le site</small>
|
||||
@@ -162,13 +160,14 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<fieldset id="fieldset-types">
|
||||
<legend>Types de travaux</legend>
|
||||
<p>Active ou désactive les types de travaux dans les formulaires et la consultation. Un type désactivé ne peut plus être soumis ni affiché sur le site.</p>
|
||||
<p class="param-note">Le type <strong>TFE</strong> est toujours actif et ne peut pas être désactivé.</p>
|
||||
|
||||
<div class="param-form" id="param-form-types">
|
||||
<div class="param-form">
|
||||
<input type="hidden" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
|
||||
<input type="hidden" name="section" value="objet_types">
|
||||
|
||||
<label class="param-checkbox param-checkbox--disabled">
|
||||
<input type="checkbox" disabled checked>
|
||||
@@ -185,8 +184,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-types"
|
||||
hx-vals='{"section":"objet_types"}'>
|
||||
hx-include="#fieldset-types">
|
||||
<span>
|
||||
<strong>Thèse</strong><br>
|
||||
<small>Thèses doctorales</small>
|
||||
@@ -200,8 +198,7 @@
|
||||
hx-post="/admin/actions/settings.php"
|
||||
hx-trigger="change"
|
||||
hx-swap="none"
|
||||
hx-include="#param-form-types"
|
||||
hx-vals='{"section":"objet_types"}'>
|
||||
hx-include="#fieldset-types">
|
||||
<span>
|
||||
<strong>Frart</strong><br>
|
||||
<small>Formation de recherche en art</small>
|
||||
|
||||
Reference in New Issue
Block a user