mirror of https://github.com/apache/archiva.git
[MRM-862] Paginate Dependencies Page.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1399507 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
6b221f10bc
commit
86f58f2457
|
@ -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();
|
||||
|
|
|
@ -43,6 +43,7 @@
|
|||
};
|
||||
this.gridUpdateCallBack = configuration.gridUpdateCallBack;
|
||||
this.pageLinksUpdateCallBack = configuration.pageLinksUpdateCallBack;
|
||||
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -626,41 +626,10 @@
|
|||
|
||||
|
||||
<div id="artifact-details-dependencies-content" class="tab-pane">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
{{if projectVersionMetadata.dependencies && projectVersionMetadata.dependencies.length>0}}
|
||||
{{each(i,dependency) projectVersionMetadata.dependencies}}
|
||||
<tr>
|
||||
<th>${dependency.artifactId}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{var entries=dependency.crumbEntries()}}
|
||||
{{each(j,crumbEntry) entries}}
|
||||
{{if j < entries.length - 2}}
|
||||
<a href="#" data-bind="click: function(){displayGroup(crumbEntry.groupId)}">${crumbEntry.displayValue}</a>
|
||||
{{else j == entries.length - 2}}
|
||||
<a href="#" data-bind="click: function(){displayArtifactDetailView(crumbEntry.groupId,crumbEntry.artifactId)}">${crumbEntry.displayValue}</a>
|
||||
{{else j == entries.length - 1}}
|
||||
| <b>${$.i18n.prop('browse.artifact.version')}:</b>
|
||||
<a href="#" data-bind="click: function(){displayArtifactVersionDetailViewModel(crumbEntry.groupId,crumbEntry.artifactId,crumbEntry.version)}">${dependency.version}</a>
|
||||
{{/if}}
|
||||
{{if j < entries.length - 2}}
|
||||
/
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
||||
{{if dependency.scope}}
|
||||
| <b>${$.i18n.prop('browse.artifact.scope')}:</b> ${dependency.scope}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
{{else}}
|
||||
${$.i18n.prop('browse.artifact.dependencies.none')}
|
||||
{{/if}}
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-striped table-bordered" id="artifact-dependencies-table"
|
||||
data-bind="simpleGrid: gridViewModel,simpleGridTemplate:'ko_dependenciesGrid',pageLinksId:'dependenciesPagination',data:'dependencies'">
|
||||
</table>
|
||||
<div id="dependenciesPagination"></div>
|
||||
</div>
|
||||
|
||||
<div id="artifact-details-dependency-tree-content" class="tab-pane"></div>
|
||||
|
@ -737,6 +706,42 @@
|
|||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<script id="ko_dependenciesGrid" type="text/html">
|
||||
<tbody>
|
||||
|
||||
|
||||
{{each(i, row) itemsOnCurrentPage()}}
|
||||
<tr>
|
||||
<th>${row.artifactId}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
{{var entries=row.crumbEntries()}}
|
||||
{{each(j,crumbEntry) entries}}
|
||||
{{if j < entries.length - 2}}
|
||||
<a href="#" data-bind="click: function(){displayGroup(crumbEntry.groupId)}">${crumbEntry.displayValue}</a>
|
||||
{{else j == entries.length - 2}}
|
||||
<a href="#" data-bind="click: function(){displayArtifactDetailView(crumbEntry.groupId,crumbEntry.artifactId)}">${crumbEntry.displayValue}</a>
|
||||
{{else j == entries.length - 1}}
|
||||
| <b>${$.i18n.prop('browse.artifact.version')}:</b>
|
||||
<a href="#" data-bind="click: function(){displayArtifactVersionDetailViewModel(crumbEntry.groupId,crumbEntry.artifactId,crumbEntry.version)}">${row.version}</a>
|
||||
{{/if}}
|
||||
{{if j < entries.length - 2}}
|
||||
/
|
||||
{{/if}}
|
||||
{{/each}}
|
||||
|
||||
{{if row.scope}}
|
||||
| <b>${$.i18n.prop('browse.artifact.scope')}:</b> ${row.scope}
|
||||
{{/if}}
|
||||
</td>
|
||||
</tr>
|
||||
{{/each}}
|
||||
|
||||
</tbody>
|
||||
</script>
|
||||
|
||||
<script id="dependency_tree_tmpl" type="text/html">
|
||||
|
|
Loading…
Reference in New Issue