Commit 805181a0 by Bence Dányi

firewall_gui: autocomplete for usernames

parent 87c7b63c
......@@ -293,7 +293,7 @@ function EntityController(url, init) {
}
$http.get(url + id + '/').success(function success(data) {
$scope.entity = data;
['vlan', 'vlangroup', 'host', 'hostgroup', 'firewall'].forEach(function(t) {
['vlan', 'vlangroup', 'host', 'hostgroup', 'firewall', 'owner', 'domain', 'record'].forEach(function(t) {
$('.' + t).typeahead({
/**
* Typeahead does AJAX queries
......
......@@ -56,7 +56,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -30,7 +30,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -58,7 +58,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -55,7 +55,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -56,7 +56,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -28,7 +28,7 @@
<div class="control-group" ng-class="hasError('owner')">
<label class="control-label" for="owner">Owner</label>
<div class="controls">
<input type="text" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<input type="text" class="owner" autocomplete="off" id="owner" ng-model="entity.owner.name" />
<span class="help-inline" ng-bind="getError('owner')"></span>
</div>
</div>
......
......@@ -433,9 +433,10 @@ def autocomplete(request, entity):
'firewall': make_autocomplete(Firewall),
'domain': make_autocomplete(Domain),
'record': make_autocomplete(Record),
'owner': make_autocomplete(User, 'username')
}[entity](request)
except Exception as e:
return HttpResponse('>:-3', status=500)
return HttpResponse('>:-3'+str(e), status=500)
def set_field(object, attr, errors, **kwargs):
......
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