From 07aafa69cf7c43f0907e5220f7696e1654f65201 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 2 Jan 2013 10:51:04 +0000 Subject: [PATCH] =?utf8?q?[MRM-1734]=C2=A0add=20some=20filtering=20for=20s?= =?utf8?q?earching=20in=20users=20table?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1427725 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/redback/users.js | 58 +++++++++++++++++-- .../js/templates/redback/user-edit.html | 28 ++++++++- 2 files changed, 78 insertions(+), 8 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js index dca2c84ee..d3df7fb8e 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js @@ -51,10 +51,51 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { }); clearFilters=function(){ self.users(self.originalUsers()); - applyAutocompleteOnHeader("username",self); - applyAutocompleteOnHeader("fullName",self); - applyAutocompleteOnHeader("email",self); + applyAutocompleteOnHeaders(self); }; + filterLocked=function(){ + var founds=[]; + $(self.originalUsers()).each(function(idx,user){ + if(user.locked()){ + founds.push(user); + } + }); + self.users(founds); + applyAutocompleteOnHeaders(self); + } + filterNonLocked=function(){ + var founds=[]; + $(self.originalUsers()).each(function(idx,user){ + if(user.locked()==false){ + founds.push(user); + } + }); + self.users(founds); + applyAutocompleteOnHeaders(self); + } + + filterPasswordChangeRequired=function(){ + var founds=[]; + $(self.originalUsers()).each(function(idx,user){ + if(user.passwordChangeRequired()){ + founds.push(user); + } + }); + self.users(founds); + applyAutocompleteOnHeaders(self); + } + filterPasswordChangeNotRequired=function(){ + var founds=[]; + $(self.originalUsers()).each(function(idx,user){ + if(user.passwordChangeRequired()==false){ + founds.push(user); + } + }); + self.users(founds); + applyAutocompleteOnHeaders(self); + } + + this.addUser=function() { clearUserMessages(); var mainContent = $("#main-content"); @@ -298,15 +339,20 @@ function(jquery,utils,i18n,jqueryValidate,ko,koSimpleGrid) { }) mainContent.find("#users-view-tabs-content #users-view").addClass("active"); - applyAutocompleteOnHeader("username",usersViewModel); - applyAutocompleteOnHeader("fullName",usersViewModel); - applyAutocompleteOnHeader("email",usersViewModel); + applyAutocompleteOnHeaders(usersViewModel); + mainContent.find("#usersTable").find('.dropdown-toggle').dropdown(); } } ); } + applyAutocompleteOnHeaders=function(usersViewModel){ + applyAutocompleteOnHeader("username",usersViewModel); + applyAutocompleteOnHeader("fullName",usersViewModel); + applyAutocompleteOnHeader("email",usersViewModel); + } + activateUsersGridTab=function(){ var mainContent = $("#main-content"); mainContent.find("#users-view-tabs li").removeClass("active"); diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html index 6ec095661..304597ccb 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html @@ -200,8 +200,32 @@ {{/each}} - locked ? - chg pwd + +
+ + Filter + + + +
+ + +
+ + Filter + + + +
+ -- 2.39.5