From 962f02573fb8670b248c071450cfe766a2fe240f Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 29 Apr 2025 11:07:55 +0200 Subject: 🐛 fix quick add of organization and persons on some wizards forms (refs #6280, refs #6279) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/forms_common.py | 2 +- ishtar_common/templates/base.html | 4 +++- ishtar_common/widgets.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ishtar_common/forms_common.py b/ishtar_common/forms_common.py index e6428fa86..963527e6f 100644 --- a/ishtar_common/forms_common.py +++ b/ishtar_common/forms_common.py @@ -1359,7 +1359,7 @@ class PersonForm(SimplePersonForm): label=_("Person types"), choices=[], required=False, - widget=widgets.Select2Multiple, + widget=widgets.Select2Multiple(attrs={"cols": True, "full-width": True}), ) TYPES = SimplePersonForm.TYPES + [ FieldType("person_types", models.PersonType, True) diff --git a/ishtar_common/templates/base.html b/ishtar_common/templates/base.html index f08bfc77b..5101e9040 100644 --- a/ishtar_common/templates/base.html +++ b/ishtar_common/templates/base.html @@ -18,6 +18,7 @@ + {# #} @@ -65,7 +66,8 @@ - + + {% for url_css in JQGRID_CSS %}{% endfor %} {{EXTRA_CSS|safe}} diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 765ed7b77..d0ade6fea 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -124,6 +124,7 @@ class SelectReadonlyField(forms.ChoiceField): class Select2Media: @property def media(self): + # TODO: to remove? put in on base.html css = {"all": ("select2/css/select2.css",)} js = ["select2/js/select2.full.min.js"] for lang_code, lang in settings.LANGUAGES: -- cgit v1.2.3