]> source.dussan.org Git - archiva.git/commitdiff
move grid pager template to a generic place and use only this one
authorOlivier Lamy <olamy@apache.org>
Mon, 2 Jan 2012 13:59:46 +0000 (13:59 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 2 Jan 2012 13:59:46 +0000 (13:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1226421 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/grids-generics.html [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html

index 9295369d303e3bed617be40016a280e0e60f0508..a7dbda3cf508df99f9a6211f7e26339ff8623e88 100644 (file)
  * 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
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/grids-generics.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/grids-generics.html
new file mode 100644 (file)
index 0000000..9aeb887
--- /dev/null
@@ -0,0 +1,13 @@
+<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
index f0a97566b10632a1bf6c835e271a18456c559575..a86f7d8b6e305aff98263d2ebd6ae7e740eafded 100644 (file)
@@ -50,7 +50,7 @@
 
           // 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"));
index b5d2ce7b752a300a0d51d7c4893d9ce2383ba750..8ec37303f70ccfb1a5862ecadd557e2e8a0bb8eb 100644 (file)
@@ -14,7 +14,7 @@
   <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>
+
index 5a1abb79ba8f3d75eb177a1ba21797bfd634e41b..448789e3af4c4cd255c7c94f8c95a036fd80fc1e 100644 (file)
 
 </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>