var roles = $.map(data.role, function(item) {
return mapRole(item);
});
- $("#main-content").html($("#rolesGrid").tmpl(data));
+
+ $("#main-content").html($("#rolesTabs").tmpl());
+ $("#main-content #roles-view-tabs-content #roles-view").html($("#rolesGrid").tmpl(data));
+ activateRolesGridTab();
}
}
);
return new role(data.name, data.description);
}
+ activateRolesGridTab=function(){
+ $("#main-content #roles-view-tabs li").removeClass("active");
+ $("#main-content #roles-view-tabs-content div").removeClass("active");
+ // activate roles grid tab
+ $("#main-content #roles-view-tabs-content #roles-view").addClass("active");
+ $("#main-content #roles-view-tabs-li-roles-grid").addClass("active");
+ }
+
+ activateRoleEditTab=function(){
+ $("#main-content #roles-view-tabs li").removeClass("active");
+ $("#main-content #roles-view-tabs-content div").removeClass("active");
+ // activate role edit tab
+ $("#main-content #roles-view-tabs-content #role-edit").addClass("active");
+ $("#roles-view-tabs-li-roles-edit").addClass("active");
+ }
+
});
\ No newline at end of file
<script id="rolesGrid" type="text/x-jquery-tmpl">
- <div class="page-header">
- <h2>${$.i18n.prop('roles.list')}</h2>
- </div>
<table class="bordered-table zebra-striped" id="rolesTable">
<thead>
<tr>
{{/each}}
</tbody>
</table>
+</script>
+
+<script id="rolesTabs" type="text/x-jquery-tmpl">
+ <div class="page-header">
+ <h2>${$.i18n.prop('roles.list')}</h2>
+ </div>
+
+ <ul id="roles-view-tabs" class="tabs">
+ <li class="active" id="roles-view-tabs-li-roles-grid">
+ <a href="#roles-view">${$.i18n.prop('roles.grid.tab.title')}</a>
+ </li>
+ <li id="roles-view-tabs-li-roles-edit">
+ <a href="#role-edit">${$.i18n.prop('role.edit')}</a>
+ </li>
+ </ul>
+ <div id="roles-view-tabs-content" class="tab-content">
+ <div id="roles-view">
+ </div>
+ <div id="role-edit"></div>
+ </div>
+
</script>
\ No newline at end of file
<div id="users-view-tabs-content" class="tab-content">
<div id="users-view">
<button data-bind='click: sortByName' class="btn">
- Sort by name
+ ${$.i18n.prop('users.sort.byname')}
</button>
<table class="bordered-table zebra-striped" data-bind="simpleGrid: gridViewModel" id="usersTable"></table>
<div id="usersPagination"></div>