diff --git a/CHANGELOG.rst b/CHANGELOG.rst index dc1f385d38af6dc4dca53c5a90c0816f619924b5..7d226c3989ecbbefdb5e1917383b44d181fa6419 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -26,6 +26,7 @@ Fixed * Optimize exam model and add reference to exams at extra lessons. * Lessons weren't shown as cancelled on teacher or room timetables if events had replaced them. +* The teacher dropdown field in the substitution edit form did not work. `2.3`_ - 2022-03-21 ------------------- diff --git a/aleksis/apps/chronos/forms.py b/aleksis/apps/chronos/forms.py index defa890c237c46225f638f297ef4dd47aa665c18..c0d40d7032942bf2eb83c7f7ff506feb674f28d9 100644 --- a/aleksis/apps/chronos/forms.py +++ b/aleksis/apps/chronos/forms.py @@ -18,7 +18,8 @@ class LessonSubstitutionForm(forms.ModelForm): "first_name__icontains", "last_name__icontains", "short_name__icontains", - ] + ], + attrs={"data-minimum-input-length": 0, "class": "browser-default"}, ) } diff --git a/aleksis/apps/chronos/templates/chronos/edit_substitution.html b/aleksis/apps/chronos/templates/chronos/edit_substitution.html index 4f43c0b617c8e1ee45fe017a75cdd14e46b1c2cb..7f58113afe0f4c09092913b7a0e28dcbbf3e4bf4 100644 --- a/aleksis/apps/chronos/templates/chronos/edit_substitution.html +++ b/aleksis/apps/chronos/templates/chronos/edit_substitution.html @@ -1,7 +1,12 @@ {# -*- engine:django -*- #} {% extends "core/base.html" %} -{% load material_form i18n %} +{% load material_form i18n any_js %} + +{% block extra_head %} + {{ edit_substitution_form.media.css }} + {% include_css "select2-materialize" %} +{% endblock %} {% block browser_title %}{% blocktrans %}Edit substitution.{% endblocktrans %}{% endblock %} {% block page_title %}{% blocktrans %}Edit substitution{% endblocktrans %}{% endblock %} @@ -21,4 +26,6 @@ </a> {% endif %} </form> + {% include_js "select2-materialize" %} + {{ edit_substitution_form.media.js }} {% endblock %}