Better select widget when searching organizers

This commit is contained in:
Emmy D'Anello 2023-02-20 01:32:02 +01:00
parent 4075f6cf78
commit 731dfc049f
Signed by: ynerant
GPG Key ID: 3A75C55819C8CF85
2 changed files with 8 additions and 1 deletions

View File

@ -137,7 +137,9 @@ class TournamentForm(forms.ModelForm):
format='%Y-%m-%d %H:%M') format='%Y-%m-%d %H:%M')
self.fields["syntheses_second_phase_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'}, self.fields["syntheses_second_phase_limit"].widget = forms.DateTimeInput(attrs={'type': 'datetime-local'},
format='%Y-%m-%d %H:%M') 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() self.fields["organizers"].queryset = VolunteerRegistration.objects.all()
class Meta: class Meta:

View File

@ -23,11 +23,16 @@
<link rel="stylesheet" href="{% static 'fontawasome/css/all.css' %}"> <link rel="stylesheet" href="{% static 'fontawasome/css/all.css' %}">
<link rel="stylesheet" href="{% static 'fontawasome/css/v4-shims.css' %}"> <link rel="stylesheet" href="{% static 'fontawasome/css/v4-shims.css' %}">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/css/bootstrap-select.min.css">
{# JQuery, Bootstrap and Turbolinks JavaScript #} {# JQuery, Bootstrap and Turbolinks JavaScript #}
<script src="{% static 'jquery/jquery-3.6.0.min.js' %}"></script> <script src="{% static 'jquery/jquery-3.6.0.min.js' %}"></script>
<script src="{% static 'bootstrap/js/bootstrap.bundle.min.js' %}"></script> <script src="{% static 'bootstrap/js/bootstrap.bundle.min.js' %}"></script>
<script src="{% static 'turbolinks/turbolinks.js' %}"></script> <script src="{% static 'turbolinks/turbolinks.js' %}"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.14.0-beta3/js/bootstrap-select.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-select/1.13.18/js/i18n/defaults-fr_FR.min.js"></script>
{# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #} {# Si un formulaire requiert des données supplémentaires (notamment JS), les données sont chargées #}
{% if form.media %} {% if form.media %}
{{ form.media }} {{ form.media }}