display roles in a table

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1224735 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2011-12-26 15:06:41 +00:00
parent 324cfd1d3c
commit c8ac77839c
3 changed files with 26 additions and 2 deletions

View File

@ -18,8 +18,8 @@
*/
require(["text!redback/templates/user-edit.html", "text!redback/templates/user-grids.html", "text!redback/templates/login.html"
, "text!redback/templates/register-form.html","text!redback/templates/password-change-form.html"
,"text!redback/templates/user-edit-form.html"],
function(usercreate, usergrids, login,register,passwordchange,useredit) {
,"text!redback/templates/user-edit-form.html","text!redback/templates/roles-tmpl.html"],
function(usercreate, usergrids, login,register,passwordchange,useredit,roles_tmpl) {
$.tmpl( login, $.i18n.map ).appendTo("#html-fragments");
@ -29,5 +29,7 @@ require(["text!redback/templates/user-edit.html", "text!redback/templates/user-g
// template loading
$("#html-fragments").append(usercreate);
$("#html-fragments").append(usergrids);
$("#html-fragments").append(roles_tmpl);
}
);

View File

@ -24,6 +24,8 @@ $(function() {
}
displayRolesGrid = function(){
$("#user-messages").html("");
$("#main-content").html("");
$.ajax("restServices/redbackServices/roleManagementService/allRoles",
{
type: "GET",
@ -33,6 +35,8 @@ $(function() {
var roles = $.map(data.role, function(item) {
return mapRole(item);
});
$("#main-content").html($("#rolesGrid").tmpl(data));
}
}
);

View File

@ -0,0 +1,18 @@
<script id="rolesGrid" type="text/x-jquery-tmpl">
<table class="bordered-table zebra-striped" id="rolesTable">
<thead>
<tr>
<td>${$.i18n.prop('roles.name')}</td>
<td>${$.i18n.prop('roles.description')}</td>
</tr>
</thead>
<tbody>
{{each role}}
<tr>
<td>${$value.name}</td>
<td>${$value.description}</td>
</tr>
{{/each}}
</tbody>
</table>
</script>