From 731dfc049f69735278f61d945dc9cf596f1c7974 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Mon, 20 Feb 2023 01:32:02 +0100 Subject: [PATCH] Better select widget when searching organizers --- apps/participation/forms.py | 4 +++- tfjm/templates/base.html | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/participation/forms.py b/apps/participation/forms.py index b75c1b8..4d5d71e 100644 --- a/apps/participation/forms.py +++ b/apps/participation/forms.py @@ -137,7 +137,9 @@ class TournamentForm(forms.ModelForm): format='%Y-%m-%d %H:%M') self.fields["syntheses_second_phase_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'}, format='%Y-%m-%d %H:%M') - self.fields["organizers"].widget = forms.CheckboxSelectMultiple() + self.fields["organizers"].widget.attrs['class'] = 'selectpicker' + self.fields["organizers"].widget.attrs['data-live-search'] = 'true' + self.fields["organizers"].widget.attrs['data-live-search-normalize'] = 'true' self.fields["organizers"].queryset = VolunteerRegistration.objects.all() class Meta: diff --git a/tfjm/templates/base.html b/tfjm/templates/base.html index 2f9da33..b86c98e 100644 --- a/tfjm/templates/base.html +++ b/tfjm/templates/base.html @@ -23,11 +23,16 @@ + + {# JQuery, Bootstrap and Turbolinks JavaScript #} + + + {# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #} {% if form.media %} {{ form.media }}