Skip to content

Commit

Permalink
Add select2 class to choice fields
Browse files Browse the repository at this point in the history
This makes multiple choice drop down lists in Alert Profiles filter
searchable using select2, which makes it a lot easier to find desired
values when the choice lists become huge.
  • Loading branch information
lunkwill42 committed Nov 24, 2024
1 parent 27b12b5 commit 7ff0996
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions python/nav/web/alertprofiles/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,7 @@ def __init__(self, *args, **kwargs):

# At last we acctually add the multiple choice field.
self.fields['value'] = forms.MultipleChoiceField(choices=choices)
self.fields['value'].widget.attrs['class'] = 'select2'
else:
self.fields['value'] = forms.CharField(required=True)

Expand Down

0 comments on commit 7ff0996

Please sign in to comment.