* under the License.
*/
require(["text!archiva/templates/menu.html","text!archiva/templates/topbar.html","text!archiva/templates/message.html",
- "text!archiva/templates/modal.html"],
- function(menu,topbar,message,modal) {
+ "text!archiva/templates/modal.html","text!archiva/templates/grids-generics.html"],
+ function(menu,topbar,message,modal,grids_generics) {
// template loading
$.tmpl( menu, $.i18n.map ).appendTo("#html-fragments");
$.tmpl( topbar, $.i18n.map ).appendTo("#html-fragments");
$.tmpl( modal, $.i18n.map ).appendTo("#html-fragments");
$("#html-fragments").append(message);
+ $("#html-fragments").append(grids_generics);
$.log("main-tmpl.js menu loaded");
}
);
\ No newline at end of file
--- /dev/null
+<script id="ko_simpleGrid_pageLinks" type="text/x-jquery-tmpl">
+ <div class="pagination">
+ <ul>
+ {{each(i) ko.utils.range(1, maxPageIndex)}}
+ <li data-bind="css: { active: i == currentPageIndex() }">
+ <a href="#" data-bind="click: function() { currentPageIndex(i) }">
+ ${ i + 1 }
+ </a>
+ </li>
+ {{/each}}
+ </ul>
+ </div>
+</script>
\ No newline at end of file
// Allow the default templates to be overridden
var gridTemplateName = allBindings.simpleGridTemplate || "ko_usersGrid_grid",
- pageLinksTemplateName = allBindings.simpleGridPagerTemplate || "ko_usersGrid_pageLinks";
+ pageLinksTemplateName = allBindings.simpleGridPagerTemplate || "ko_simpleGrid_pageLinks";
// Render the main grid
var gridContainer = element.appendChild(document.createElement("DIV"));
<div id="roles-view-tabs-content" class="tab-content">
<div id="roles-view">
<table class="bordered-table zebra-striped" id="usersTable"
- data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko_rolesGrid',simpleGridPagerTemplate:'ko_rolesGrid_pageLinks',pageLinksId:'rolesPagination'">
+ data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko_rolesGrid',pageLinksId:'rolesPagination'">
</table>
<div id="rolesPagination"></div>
</div>
</script>
-<script id="ko_rolesGrid_pageLinks" type="text/x-jquery-tmpl">
- <div class="pagination">
- <ul>
- {{each(i) ko.utils.range(1, maxPageIndex)}}
- <li data-bind="css: { active: i == currentPageIndex() }">
- <a href="#" data-bind="click: function() { currentPageIndex(i) }">
- ${ i + 1 }
- </a>
- </li>
- {{/each}}
- </ul>
- </div>
-</script>
+
</script>
-<script id="ko_usersGrid_pageLinks" type="text/x-jquery-tmpl">
- <div class="pagination">
- <ul>
- {{each(i) ko.utils.range(1, maxPageIndex)}}
- <li data-bind="css: { active: i == currentPageIndex() }">
- <a href="#" data-bind="click: function() { currentPageIndex(i) }">
- ${ i + 1 }
- </a>
- </li>
- {{/each}}
- </ul>
- </div>
-</script>
-
-
<script id="usersGrid" type="text/x-jquery-tmpl">
<div class="page-header">
<h2>${$.i18n.prop('users.list')}</h2>
${$.i18n.prop('users.sort.byname')}
</button>
<table class="bordered-table zebra-striped" id="usersTable"
- data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko_usersGrid_grid',simpleGridPagerTemplate:'ko_usersGrid_pageLinks',pageLinksId:'usersPagination'">
+ data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko_usersGrid_grid',pageLinksId:'usersPagination'">
</table>
<div id="usersPagination"></div>
</div>