From 14f28ef40558b07d172db4c51eeac3fd30ff5151 Mon Sep 17 00:00:00 2001 From: Tykayn Date: Wed, 28 May 2025 17:15:47 +0200 Subject: [PATCH] button toggle show all --- assets/app.js | 16 ++++++++++++++++ templates/public/edit.html.twig | 14 ++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/assets/app.js b/assets/app.js index cb69778..0db5fd4 100644 --- a/assets/app.js +++ b/assets/app.js @@ -34,5 +34,21 @@ document.addEventListener('DOMContentLoaded', () => { bodyLanding.style.backgroundColor = randombg; } + // Gestion du bouton pour afficher tous les champs + const btnShowAllFields = document.querySelector('#showAllFields'); + if (btnShowAllFields) { + console.log('btnShowAllFields détecté'); + btnShowAllFields.addEventListener('click', () => { + // Sélectionner tous les inputs dans le formulaire + const form = document.querySelector('form'); + if (form) { + const hiddenInputs = form.querySelectorAll('.d-none'); + hiddenInputs.forEach(input => { + input.classList.toggle('d-none'); + }); + } + }); + } + }); diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index 0bae6e2..aa92c69 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -88,7 +88,21 @@ {{ 'display.submit'|trans }} +
+ + +
+ + + +
{% endif %}