]> source.dussan.org Git - archiva.git/commitdiff
move roles list view to a tab format to display role detail in a tab
authorOlivier Lamy <olamy@apache.org>
Wed, 28 Dec 2011 13:31:23 +0000 (13:31 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 28 Dec 2011 13:31:23 +0000 (13:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1225183 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html

index 99a7d68270b068833e6d06d5d1065bb93f32566b..69c6792d0b7359166bf07d84316b23a916ca891e 100644 (file)
@@ -35,7 +35,10 @@ $(function() {
          var roles = $.map(data.role, function(item) {
              return mapRole(item);
          });
-         $("#main-content").html($("#rolesGrid").tmpl(data));
+
+         $("#main-content").html($("#rolesTabs").tmpl());
+         $("#main-content #roles-view-tabs-content #roles-view").html($("#rolesGrid").tmpl(data));
+         activateRolesGridTab();
        }
       }
     );
@@ -48,4 +51,20 @@ $(function() {
     return new role(data.name, data.description);
   }
 
+  activateRolesGridTab=function(){
+    $("#main-content #roles-view-tabs li").removeClass("active");
+    $("#main-content #roles-view-tabs-content div").removeClass("active");
+    // activate roles grid tab
+    $("#main-content #roles-view-tabs-content #roles-view").addClass("active");
+    $("#main-content #roles-view-tabs-li-roles-grid").addClass("active");
+  }
+
+  activateRoleEditTab=function(){
+    $("#main-content #roles-view-tabs li").removeClass("active");
+    $("#main-content #roles-view-tabs-content div").removeClass("active");
+    // activate role edit tab
+    $("#main-content #roles-view-tabs-content #role-edit").addClass("active");
+    $("#roles-view-tabs-li-roles-edit").addClass("active");
+  }
+
 });
\ No newline at end of file
index 2d8989df1f73506cd4223803063886966c1e32db..fcd03bacbaa157a50b6bfcef82191003905da9cd 100644 (file)
@@ -1,7 +1,4 @@
 <script id="rolesGrid"  type="text/x-jquery-tmpl">
-  <div class="page-header">
-    <h2>${$.i18n.prop('roles.list')}</h2>
-  </div>
   <table class="bordered-table zebra-striped" id="rolesTable">
     <thead>
       <tr>
       {{/each}}
     </tbody>
   </table>
+</script>
+
+<script id="rolesTabs" type="text/x-jquery-tmpl">
+  <div class="page-header">
+    <h2>${$.i18n.prop('roles.list')}</h2>
+  </div>
+
+  <ul id="roles-view-tabs" class="tabs">
+    <li class="active" id="roles-view-tabs-li-roles-grid">
+      <a href="#roles-view">${$.i18n.prop('roles.grid.tab.title')}</a>
+    </li>
+    <li id="roles-view-tabs-li-roles-edit">
+      <a href="#role-edit">${$.i18n.prop('role.edit')}</a>
+    </li>
+  </ul>
+  <div id="roles-view-tabs-content" class="tab-content">
+    <div id="roles-view">
+    </div>
+    <div id="role-edit"></div>
+  </div>
+
 </script>
\ No newline at end of file
index 704cb068c7d7ac64167f387c9892f57551dac701..a812af8eb643636d65e84b16338f6fc383a2d1cd 100644 (file)
     <div id="users-view-tabs-content" class="tab-content">
       <div id="users-view">
         <button data-bind='click: sortByName'  class="btn">
-          Sort by name
+            ${$.i18n.prop('users.sort.byname')}
         </button>
         <table class="bordered-table zebra-striped" data-bind="simpleGrid: gridViewModel" id="usersTable"></table>
         <div id="usersPagination"></div>