From 5b68adaf872ee672c4f6f956147ae611d5ab6b29 Mon Sep 17 00:00:00 2001 From: Iziram Date: Wed, 31 Jul 2024 16:08:21 +0200 Subject: [PATCH] =?UTF-8?q?multiselect.py=20+=20fix=20bug=20event=20+=20ch?= =?UTF-8?q?angement=20ic=C3=B4ne=20+=20unfixed=20height?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/forms/multiselect.py | 118 ++++++++++++++++++++++++++++++++++ app/scodoc/sco_groups_view.py | 2 +- app/scodoc/sco_utils.py | 117 +-------------------------------- app/static/js/multi-select.js | 22 ++++--- 4 files changed, 135 insertions(+), 124 deletions(-) create mode 100644 app/forms/multiselect.py diff --git a/app/forms/multiselect.py b/app/forms/multiselect.py new file mode 100644 index 00000000..77b13626 --- /dev/null +++ b/app/forms/multiselect.py @@ -0,0 +1,118 @@ +""" +Simplification des multiselect HTML/JS +""" + + +class MultiSelect: + """ + Classe pour faciliter l'utilisation du multi-select HTML/JS + + Les values sont représentées en dict { + value: "...", + label:"...", + selected: True/False (default to False), + single: True/False (default to False) + } + + Args: + values (dict[str, list[dict]]): Dictionnaire des valeurs + génère des pour chaque clef du dictionnaire + génère des