archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1427725 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js: redback/users.js templates/redback/user-edit.html
Date Wed, 02 Jan 2013 10:51:04 GMT
Author: olamy
Date: Wed Jan  2 10:51:04 2013
New Revision: 1427725

URL: http://svn.apache.org/viewvc?rev=1427725&view=rev
Log:
[MRM-1734] add some filtering for searching in users table

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js?rev=1427725&r1=1427724&r2=1427725&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/redback/users.js
Wed Jan  2 10:51:04 2013
@@ -51,10 +51,51 @@ function(jquery,utils,i18n,jqueryValidat
     });
     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,jqueryValidat
 
           })
           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");

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html?rev=1427725&r1=1427724&r2=1427725&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/redback/user-edit.html
Wed Jan  2 10:51:04 2013
@@ -200,8 +200,32 @@
       {{/each}}
       <th></th>
       <th></th>
-      <th>locked ?</th>
-      <th>chg pwd</th>
+      <th>
+        <div class="btn-group" style="vertical-align: top; padding-bottom: 9px;">
+          <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
+            Filter
+            <span class="caret"></span>
+          </a>
+          <ul class="dropdown-menu">
+            <li><a href="#" class="cursor-hand" data-bind="click: clearFilters">${$.i18n.prop('users.grid.filter.all')}</a></li>
+            <li><a href="#" class="cursor-hand" data-bind="click: filterLocked">${$.i18n.prop('users.grid.filter.locked')}</a></li>
+            <li><a href="#" class="cursor-hand" data-bind="click: filterNonLocked">${$.i18n.prop('users.grid.filter.not.locked')}</a></li>
+          </ul>
+        </div>
+      </th>
+      <th>
+        <div class="btn-group" style="vertical-align: top; padding-bottom: 9px;">
+          <a class="btn btn-small dropdown-toggle" data-toggle="dropdown" href="#">
+            Filter
+            <span class="caret"></span>
+          </a>
+          <ul class="dropdown-menu">
+            <li><a href="#" class="cursor-hand" data-bind="click: clearFilters">${$.i18n.prop('users.grid.filter.all')}</a></li>
+            <li><a href="#" class="cursor-hand" data-bind="click: filterPasswordChangeRequired">${$.i18n.prop('users.grid.filter.pwd.change.required')}</a></li>
+            <li><a href="#" class="cursor-hand" data-bind="click: filterPasswordChangeNotRequired">${$.i18n.prop('users.grid.filter.pwd.change.not.required')}</a></li>
+          </ul>
+        </div>
+      </th>
     </tr>
   </thead>
   <tbody>



Mime
View raw message