KEYCLOAK-168

This commit is contained in:
Stian Thorgersen 2013-11-25 19:55:49 +00:00
parent 89ae28429a
commit 4e0d3529af
2 changed files with 12 additions and 8 deletions

View file

@ -118,12 +118,11 @@ module.controller('UserRoleMappingCtrl', function($scope, $http, realm, user, ro
module.controller('UserListCtrl', function($scope, realm, User) {
$scope.realm = realm;
$scope.searchQuery = function() {
console.log('search: ' + $scope.search);
var parameters = { search : $scope.search };
parameters["realm"] = realm.id;
$scope.users = User.query(parameters);
$scope.searchLoaded = false;
$scope.users = User.query({ realm: realm.id, search : $scope.search }, function() {
$scope.searchLoaded = true;
});
};
});

View file

@ -41,7 +41,8 @@
</tr>
</tr>
</thead>
<tfoot data-ng-show="users && users.length > 10"> <!-- todo -->
<!-- todo -->
<!--<tfoot data-ng-show="users && users.length > 10">
<tr>
<td colspan="4">
<div class="table-nav">
@ -52,7 +53,7 @@
</div>
</td>
</tr>
</tfoot>
</tfoot>-->
<tbody>
<tr ng-repeat="user in users">
<td><a href="#/realms/{{realm.id}}/users/{{user.username}}">{{user.username}}</a></td>
@ -62,9 +63,13 @@
</tr>
</tbody>
</table>
<div class="feedback warning inline" data-ng-show="users.length == 0">
<div class="feedback warning inline" data-ng-show="searchLoaded && users.length == 0">
<p><strong>Your search returned no results.</strong><br>Try modifying the query and try again.</p>
</div>
<div class="feedback info inline" data-ng-show="!search">
<br/>
<p><strong>Search for users.</strong><br>Please enter a search to display users.</p>
</div>
</div>
</div>
<div id="container-right-bg"></div>