*/
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");
// template loading
$("#html-fragments").append(usercreate);
$("#html-fragments").append(usergrids);
+ $("#html-fragments").append(roles_tmpl);
+
}
);
\ No newline at end of file
}
displayRolesGrid = function(){
+ $("#user-messages").html("");
+ $("#main-content").html("");
$.ajax("restServices/redbackServices/roleManagementService/allRoles",
{
type: "GET",
var roles = $.map(data.role, function(item) {
return mapRole(item);
});
+ $("#main-content").html($("#rolesGrid").tmpl(data));
+
}
}
);
--- /dev/null
+<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>
\ No newline at end of file