Commit a88bb448 by Karsa Zoltán István

autocomplete not working

parent 0b6b7c1e
...@@ -1423,9 +1423,8 @@ class UserEditForm(forms.ModelForm): ...@@ -1423,9 +1423,8 @@ class UserEditForm(forms.ModelForm):
helper.add_input(Submit("submit", _("Save"))) helper.add_input(Submit("submit", _("Save")))
return helper return helper
class AclUserOrGroupAddForm(forms.Form): class AclUserOrGroupAddForm(forms.Form):
name = forms.CharField( name = autocomplete.Select2ListChoiceField(
widget=autocomplete.ListSelect2( widget=autocomplete.ListSelect2(
url='autocomplete.acl.user-group', url='autocomplete.acl.user-group',
attrs={'class': 'form-control', attrs={'class': 'form-control',
...@@ -1434,7 +1433,7 @@ class AclUserOrGroupAddForm(forms.Form): ...@@ -1434,7 +1433,7 @@ class AclUserOrGroupAddForm(forms.Form):
class TransferOwnershipForm(forms.Form): class TransferOwnershipForm(forms.Form):
name = forms.CharField( name = autocomplete.Select2ListChoiceField(
widget=autocomplete.ListSelect2( widget=autocomplete.ListSelect2(
url='autocomplete.acl.user', url='autocomplete.acl.user',
attrs={'class': 'form-control', attrs={'class': 'form-control',
...@@ -1444,7 +1443,7 @@ class TransferOwnershipForm(forms.Form): ...@@ -1444,7 +1443,7 @@ class TransferOwnershipForm(forms.Form):
class AddGroupMemberForm(forms.Form): class AddGroupMemberForm(forms.Form):
new_member = forms.CharField( new_member = autocomplete.Select2ListChoiceField(
widget=autocomplete.ListSelect2( widget=autocomplete.ListSelect2(
url='autocomplete.acl.user', url='autocomplete.acl.user',
attrs={'class': 'form-control', attrs={'class': 'form-control',
......
{% load i18n %} {% load i18n %}
<form action="{{ acl.url }}" method="post">{% csrf_token %} <form action="{{ acl.url }}" method="post">{% csrf_token %}
<table class="table table-striped table-with-form-fields acl-table" id="{{table_id}}"> <table class="table table-striped table-with-form-fields acl-table" id="{{table_id}}">
<thead> <thead>
...@@ -58,7 +59,7 @@ ...@@ -58,7 +59,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
<tr><td><i class="fa fa-plus"></i></td> <tr><td><i class="fa fa-plus"></i></td>
<td>{{aclform.name }}</td> <td>{{ aclform.name }}</td>
<td><select class="form-control" name="level"> <td><select class="form-control" name="level">
{% for id, name in acl.levels %} {% for id, name in acl.levels %}
{% if id in acl.allowed_levels %} {% if id in acl.allowed_levels %}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment