mirror of https://github.com/apache/archiva.git
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:
parent
324cfd1d3c
commit
c8ac77839c
|
@ -18,8 +18,8 @@
|
||||||
*/
|
*/
|
||||||
require(["text!redback/templates/user-edit.html", "text!redback/templates/user-grids.html", "text!redback/templates/login.html"
|
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/register-form.html","text!redback/templates/password-change-form.html"
|
||||||
,"text!redback/templates/user-edit-form.html"],
|
,"text!redback/templates/user-edit-form.html","text!redback/templates/roles-tmpl.html"],
|
||||||
function(usercreate, usergrids, login,register,passwordchange,useredit) {
|
function(usercreate, usergrids, login,register,passwordchange,useredit,roles_tmpl) {
|
||||||
|
|
||||||
|
|
||||||
$.tmpl( login, $.i18n.map ).appendTo("#html-fragments");
|
$.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
|
// template loading
|
||||||
$("#html-fragments").append(usercreate);
|
$("#html-fragments").append(usercreate);
|
||||||
$("#html-fragments").append(usergrids);
|
$("#html-fragments").append(usergrids);
|
||||||
|
$("#html-fragments").append(roles_tmpl);
|
||||||
|
|
||||||
}
|
}
|
||||||
);
|
);
|
|
@ -24,6 +24,8 @@ $(function() {
|
||||||
}
|
}
|
||||||
|
|
||||||
displayRolesGrid = function(){
|
displayRolesGrid = function(){
|
||||||
|
$("#user-messages").html("");
|
||||||
|
$("#main-content").html("");
|
||||||
$.ajax("restServices/redbackServices/roleManagementService/allRoles",
|
$.ajax("restServices/redbackServices/roleManagementService/allRoles",
|
||||||
{
|
{
|
||||||
type: "GET",
|
type: "GET",
|
||||||
|
@ -33,6 +35,8 @@ $(function() {
|
||||||
var roles = $.map(data.role, function(item) {
|
var roles = $.map(data.role, function(item) {
|
||||||
return mapRole(item);
|
return mapRole(item);
|
||||||
});
|
});
|
||||||
|
$("#main-content").html($("#rolesGrid").tmpl(data));
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
|
@ -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>
|
Loading…
Reference in New Issue