8
0
Fork 0
mirror of https://gitlab2.federez.net/re2o/re2o synced 2024-11-25 04:43:10 +00:00

Add username autocompletion in event filter view

This commit is contained in:
Jean-Romain Garnier 2020-04-24 22:40:21 +00:00 committed by Gabriel Detraz
parent 4b6f5a1463
commit 147ff29fb5
2 changed files with 4 additions and 6 deletions

View file

@ -97,9 +97,9 @@ def classes_for_action_type(action_type):
class ActionsSearchForm(Form):
"""The form for a simple search"""
u = forms.CharField(
u = forms.ModelChoiceField(
label=_("Performed by"),
max_length=100,
queryset=users.models.User.objects.all(),
required=False,
)
t = forms.MultipleChoiceField(

View file

@ -22,6 +22,7 @@ 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 %}
@ -31,10 +32,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
<form class="form">
<h3>{% trans "Search events" %}</h3>
{% bootstrap_field actions_form.u %}
{% include 'buttons/multiple_checkbox_alt.html' with field=actions_form.t %}
{% bootstrap_field actions_form.s %}
{% bootstrap_field actions_form.e %}
{% massive_bootstrap_form actions_form 'u' %}
{% trans "Search" as tr_search %}
{% bootstrap_button tr_search button_type="submit" icon="search" %}
</form>