fix: add hx-swap="none" to admin auto-save checkboxes to prevent page swap

This commit is contained in:
Pontoporeia
2026-05-19 00:08:06 +02:00
parent cf9bd5cd5d
commit 7e987d281c
4 changed files with 26 additions and 16 deletions
+9 -9
View File
@@ -89,7 +89,7 @@
<legend>Restrictions d'accès aux fichiers</legend>
<div class="param-form">
<input type="hidden" id="csrf_token_files" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<input type="hidden" id="settings-csrf" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<label class="param-checkbox">
<input type="checkbox" name="restricted_files_enabled" value="1"
@@ -97,7 +97,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_files"
hx-include="#settings-csrf"
hx-vals='{"section":"formulaire"}'>
<span>
<strong>Activer la restriction d'accès</strong><br>
@@ -112,7 +112,7 @@
<p>Options de visibilité disponibles dans le formulaire d'ajout de TFE.</p>
<div class="param-form">
<input type="hidden" id="csrf_token_acces" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<input type="hidden" id="settings-csrf-acces" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<label class="param-checkbox">
<input type="checkbox" name="access_type_libre_enabled" value="1"
@@ -120,7 +120,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_acces"
hx-include="#settings-csrf-acces"
hx-vals='{"section":"formulaire"}'>
<span>
<strong>Libre</strong><br>
@@ -134,7 +134,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_acces"
hx-include="#settings-csrf-acces"
hx-vals='{"section":"formulaire"}'>
<span>
<strong>Interne</strong><br>
@@ -148,7 +148,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_acces"
hx-include="#settings-csrf-acces"
hx-vals='{"section":"formulaire"}'>
<span>
<strong>Interdit</strong><br>
@@ -164,7 +164,7 @@
<p class="param-note">Le type <strong>TFE</strong> est toujours actif et ne peut pas être désactivé.</p>
<div class="param-form">
<input type="hidden" id="csrf_token_types" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<input type="hidden" id="settings-csrf-types" name="csrf_token" value="<?= htmlspecialchars($_SESSION['csrf_token']) ?>">
<label class="param-checkbox param-checkbox--disabled">
<input type="checkbox" disabled checked>
@@ -180,7 +180,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_types"
hx-include="#settings-csrf-types"
hx-vals='{"section":"objet_types"}'>
<span>
<strong>Thèse</strong><br>
@@ -194,7 +194,7 @@
hx-post="/admin/actions/settings.php"
hx-trigger="change"
hx-swap="none"
hx-include="#csrf_token_types"
hx-include="#settings-csrf-types"
hx-vals='{"section":"objet_types"}'>
<span>
<strong>Frart</strong><br>