From db75f797c56775dce3bb436c0cdf689c2b0d1c39 Mon Sep 17 00:00:00 2001 From: chirac Date: Wed, 30 Dec 2020 18:54:50 +0100 Subject: [PATCH] Autocomplete on history search --- logs/forms.py | 2 ++ logs/templates/logs/search_stats_logs.html | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/logs/forms.py b/logs/forms.py index c98bd282..eb623827 100644 --- a/logs/forms.py +++ b/logs/forms.py @@ -25,6 +25,7 @@ from django import forms from django.forms import Form from django.utils.translation import ugettext_lazy as _ from re2o.base import get_input_formats_help_text +from re2o.mixins import AutocompleteModelMixin import inspect @@ -118,6 +119,7 @@ class ActionsSearchForm(Form): label=_("Performed by"), queryset=users.models.User.objects.all(), required=False, + widget=AutocompleteModelMixin(url="/users/user-autocomplete"), ) action_type = forms.MultipleChoiceField( label=_("Action type"), diff --git a/logs/templates/logs/search_stats_logs.html b/logs/templates/logs/search_stats_logs.html index b124139e..88c2babd 100644 --- a/logs/templates/logs/search_stats_logs.html +++ b/logs/templates/logs/search_stats_logs.html @@ -22,7 +22,6 @@ with this program; if not, write to the Free Software Foundation, Inc., {% endcomment %} {% load bootstrap3 %} -{% load massive_bootstrap_form %} {% load i18n %} {% block title %}{% trans "Search events" %}{% endblock %} @@ -32,10 +31,11 @@ with this program; if not, write to the Free Software Foundation, Inc.,

{% trans "Search events" %}

- {% massive_bootstrap_form actions_form 'u' %} + {% bootstrap_form actions_form %} {% trans "Search" as tr_search %} {% bootstrap_button tr_search button_type="submit" icon="search" %}
+{{ actions_form.media }}