role description is now updatable

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1226091 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-12-31 13:55:25 +00:00
parent d8e38bd1c2
commit 507a6593d3
2 changed files with 32 additions and 2 deletions

View File

@ -64,6 +64,29 @@ $(function() {
);
}
saveRoleDescription=function(){
var roleName = $("#editRoleTable #role-edit-name").html();
var description = $("#editRoleTable #role-edit-description").val();
clearUserMessages();
var url = "restServices/redbackServices/roleManagementService/updateRoleDescription?";
url += "roleName="+encodeURIComponent(roleName);
url += "&roleDescription="+encodeURIComponent(description);
$.ajax(url,
{
type: "GET",
dataType: 'json',
success: function(data) {
$.log("role description updated");
displaySuccessMessage($.i18n.prop("role.updated",roleName));
},
error: function(data){
displayErrorMessage("error updating role description");
}
}
);
}
/**
* @param data Role response from redback rest api
*/

View File

@ -50,11 +50,18 @@
<tbody>
<tr>
<td>${$.i18n.prop('name')}:</td>
<td>${name}</td>
<td id="role-edit-name">${name}</td>
</tr>
<tr>
<td>${$.i18n.prop('description')}:</td>
<td>${description}</td>
<td><input type="text" id="role-edit-description" value="${description}"></td>
</tr>
<tr>
<td colspan="2">
<div class="pull-left">
<button class="btn" onclick="saveRoleDescription();">${$.i18n.prop('save')}</button>
</div>
</td>
</tr>
</tbody>
</table>