From 46cc43e9bcfff8e6fac1a9013ab49b563dd00a13 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Wed, 28 Dec 2011 17:11:06 +0000 Subject: [PATCH] start implementation of role edit view git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1225237 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/redback/roles.js | 24 ++++++- .../js/redback/templates/roles-tmpl.html | 67 ++++++++++++++++++- 2 files changed, 88 insertions(+), 3 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js index 69c6792d0..10c37d57a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/roles.js @@ -18,9 +18,14 @@ */ $(function() { - role = function(name,description){ + role = function(name,description,permissions){ this.name = name; this.description = description; + this.permissions=permissions; + } + + permission = function(){ + } displayRolesGrid = function(){ @@ -29,7 +34,6 @@ $(function() { $.ajax("restServices/redbackServices/roleManagementService/allRoles", { type: "GET", - async: false, dataType: 'json', success: function(data) { var roles = $.map(data.role, function(item) { @@ -38,12 +42,28 @@ $(function() { $("#main-content").html($("#rolesTabs").tmpl()); $("#main-content #roles-view-tabs-content #roles-view").html($("#rolesGrid").tmpl(data)); + $("#roles-view-tabs").tabs(); activateRolesGridTab(); } } ); } + editRole = function(roleName){ + $.log("edit role:"+roleName); + $.ajax("restServices/redbackServices/roleManagementService/getRole/"+roleName, + { + type: "GET", + dataType: 'json', + success: function(data) { + var role = mapRole(data.role); + $("#main-content #roles-view-tabs-content #role-edit").html($("#editRoleTab").tmpl(data.role)); + activateRoleEditTab(); + } + } + ); + } + /** * @param data Role response from redback rest api */ diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html index fcd03bacb..8a856b61a 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html @@ -4,6 +4,7 @@ ${$.i18n.prop('roles.name')} ${$.i18n.prop('roles.description')} + ${$.i18n.prop('edit')} @@ -11,6 +12,9 @@ ${$value.name} ${$value.description} + + ${$.i18n.prop('edit')} + {{/each}} @@ -36,4 +40,65 @@
- \ No newline at end of file + + + -- 2.39.5