From 3a52d935814ec3b1d0ec9ce72542db73e701072b Mon Sep 17 00:00:00 2001 From: Hangzhi Yu <hangzhi@protonmail.com> Date: Thu, 29 Oct 2020 13:44:24 +0100 Subject: [PATCH] Revert child groups form changes --- aleksis/core/forms.py | 8 +------- aleksis/core/templates/core/group/child_groups.html | 13 ++----------- 2 files changed, 3 insertions(+), 18 deletions(-) diff --git a/aleksis/core/forms.py b/aleksis/core/forms.py index e0a71a8bc..4de62b87d 100644 --- a/aleksis/core/forms.py +++ b/aleksis/core/forms.py @@ -300,13 +300,7 @@ class AnnouncementForm(ExtensibleForm): class ChildGroupsForm(forms.Form): """Inline form for group editing to select child groups.""" - child_groups = forms.ModelMultipleChoiceField( - queryset=Group.objects.all(), - widget=ModelSelect2MultipleWidget( - search_fields=["name__icontains", "short_name__icontains",], - attrs={"data-minimum-input-length": 0, "class": "browser-default"}, - ), - ) + child_groups = forms.ModelMultipleChoiceField(queryset=Group.objects.all()) class SitePreferenceForm(PreferenceForm): diff --git a/aleksis/core/templates/core/group/child_groups.html b/aleksis/core/templates/core/group/child_groups.html index 589f8a6be..bb5a429f6 100644 --- a/aleksis/core/templates/core/group/child_groups.html +++ b/aleksis/core/templates/core/group/child_groups.html @@ -2,14 +2,7 @@ {% extends "core/base.html" %} -{% load i18n material_form any_js %} - - -{% block extra_head %} - {{ form.media.css }} - {% include_css "select2-materialize" %} -{% endblock %} - +{% load i18n material_form %} {% block browser_title %}{% blocktrans %}Assign child groups to groups{% endblocktrans %}{% endblock %} {% block page_title %} @@ -126,7 +119,7 @@ {% csrf_token %} - {% form form=form %}{% endform %} + {% include "components/chips.html" with form_field=form.child_groups %} <p class="left"> {% if page.has_previous %} @@ -158,6 +151,4 @@ </p> </form> {% endif %} - {% include_js "select2-materialize" %} - {{ form.media.js }} {% endblock %} -- GitLab