diff --git a/biscuit/apps/alsijil/forms.py b/biscuit/apps/alsijil/forms.py index dd64517d6aa575f3d2b540b460691a24a15afcfd..7912bcf8bccf4e0f4939cb15771010c1ab4ee741 100644 --- a/biscuit/apps/alsijil/forms.py +++ b/biscuit/apps/alsijil/forms.py @@ -1,6 +1,7 @@ from django import forms from django.db.models import Count from django.utils.translation import ugettext_lazy as _ +from django_select2.forms import Select2Widget from biscuit.apps.chronos.models import Room from biscuit.core.models import Group, Person @@ -33,15 +34,15 @@ class PersonalNoteForm(forms.ModelForm): class SelectForm(forms.Form): group = forms.ModelChoiceField( queryset=Group.objects.annotate(lessons_count=Count('lessons')).filter(lessons_count__gt=0), - label=_('Group'), required=False) + label=_('Group'), required=False, widget=Select2Widget) teacher = forms.ModelChoiceField( queryset=Person.objects.annotate(lessons_count=Count( 'lessons_as_teacher')).filter(lessons_count__gt=0), - label=_('Teacher'), required=False) + label=_('Teacher'), required=False, widget=Select2Widget) room = forms.ModelChoiceField( queryset=Room.objects.annotate(lessons_count=Count( 'lesson_periods')).filter(lessons_count__gt=0), - label=_('Room'), required=False) + label=_('Room'), required=False, widget=Select2Widget) PersonalNoteFormSet = forms.modelformset_factory( diff --git a/biscuit/apps/alsijil/templates/alsijil/week_view.html b/biscuit/apps/alsijil/templates/alsijil/week_view.html index 5b4949504a9d1d9d23abc0581172b39b7b78512f..3bf3c91c17af4ad5d1de17f8d336682fa7ae62e3 100644 --- a/biscuit/apps/alsijil/templates/alsijil/week_view.html +++ b/biscuit/apps/alsijil/templates/alsijil/week_view.html @@ -3,6 +3,16 @@ {% extends "core/turnable.html" %} {% load bootstrap4 font_awesome i18n week_helpers %} +{% block bootstrap4_extra_head %} + {{ block.super }} + {{ select_form.media.css }} +{% endblock %} + +{% block bootstrap4_extra_script %} + {{ block.super }} + {{ select_form.media.js }} +{% endblock %} + {% block bootstrap4_title %}{% blocktrans%}Current week{% endblocktrans %} — {{ block.super }}{% endblock %} {% block current_content %}