From 86f58f2457a1eaee0c81291229c867e51eb54903 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Thu, 18 Oct 2012 03:16:53 +0000 Subject: [PATCH] [MRM-862] Paginate Dependencies Page. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1399507 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/search.js | 12 +++ .../src/main/webapp/js/knockout.simpleGrid.js | 1 + .../webapp/js/templates/archiva/search.html | 75 ++++++++++--------- 3 files changed, 53 insertions(+), 35 deletions(-) diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js index 40c69f400..8c0a96cf0 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js @@ -340,6 +340,18 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno dataType: 'json', success: function(data) { self.projectVersionMetadata=mapProjectVersionMetadata(data); + + //pagination for dependencies + self.projectVersionMetadata.dependencies=ko.observableArray(self.projectVersionMetadata.dependencies?self.projectVersionMetadata.dependencies:[]); + self.gridViewModel = new ko.simpleGrid.viewModel({ + data: self.projectVersionMetadata.dependencies(), + columns: [], + pageSize: 7, + gridUpdateCallBack: function(){ + // nope + } + }); + ko.applyBindings(self,mainContent.find("#browse_artifact_detail" ).get(0)); ko.applyBindings(self,mainContent.find("#browse_breadcrumb" ).get(0)); mainContent.find("#browse-autocomplete" ).hide(); diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js index 9e1638cd2..73cff0e47 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/knockout.simpleGrid.js @@ -43,6 +43,7 @@ }; this.gridUpdateCallBack = configuration.gridUpdateCallBack; this.pageLinksUpdateCallBack = configuration.pageLinksUpdateCallBack; + } }; diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html index 980624ec4..fb0493cdc 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html @@ -626,41 +626,10 @@
- - - {{if projectVersionMetadata.dependencies && projectVersionMetadata.dependencies.length>0}} - {{each(i,dependency) projectVersionMetadata.dependencies}} - - - - - - - {{/each}} - {{else}} - ${$.i18n.prop('browse.artifact.dependencies.none')} - {{/if}} - -
${dependency.artifactId}
- {{var entries=dependency.crumbEntries()}} - {{each(j,crumbEntry) entries}} - {{if j < entries.length - 2}} - ${crumbEntry.displayValue} - {{else j == entries.length - 2}} - ${crumbEntry.displayValue} - {{else j == entries.length - 1}} -  | ${$.i18n.prop('browse.artifact.version')}:  - ${dependency.version}  - {{/if}} - {{if j < entries.length - 2}} -  /  - {{/if}} - {{/each}} - - {{if dependency.scope}} - | ${$.i18n.prop('browse.artifact.scope')}: ${dependency.scope} - {{/if}} -
+ +
+
@@ -737,6 +706,42 @@ + + + +