link to view artifact parent

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1302701 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-19 22:47:11 +00:00
parent e111ed7243
commit 6313e37b7f
2 changed files with 33 additions and 3 deletions

View File

@ -145,6 +145,11 @@ $(function() {
}
displayArtifactVersionDetailViewModel=function(groupId,artifactId,version){
var artifactVersionDetailViewModel = new ArtifactVersionDetailViewModel (groupId,artifactId,version)
artifactVersionDetailViewModel.display();
}
ArtifactVersionDetailViewModel=function(groupId,artifactId,version){
var mainContent = $("#main-content");
var self=this;
@ -153,10 +158,16 @@ $(function() {
this.version=version;
this.projectVersionMetadata=null;
displayGroupId=function(groupId){
displayGroupDetail(groupId,null);
}
displayParent=function(){
displayArtifactVersionDetailViewModel(self.projectVersionMetadata.mavenFacet.parent.groupId,self.projectVersionMetadata.mavenFacet.parent.artifactId,
self.projectVersionMetadata.mavenFacet.parent.version);
}
breadCrumbEntries=function(){
var entries = calculateBreadCrumbEntries(self.groupId);
var artifactBreadCrumbEntry = new BreadCrumbEntry(self.groupId,self.artifactId);
@ -514,12 +525,12 @@ $(function() {
if( $.isArray(data.facetList)){
for (var i=0;i<data.facetList.length;i++){
if(data.facetList[i].facetId=='org.apache.archiva.metadata.repository.storage.maven2.project'){
projectVersionMetadata.mavenFacet=new MavenFacet(data.facetList[i].packaging);
projectVersionMetadata.mavenFacet=new MavenFacet(data.facetList[i].packaging,data.facetList[i].parent);
}
}
} else {
if(data.facetList.facetId=='org.apache.archiva.metadata.repository.storage.maven2.project'){
projectVersionMetadata.mavenFacet=new MavenFacet(data.facetList.packaging);
projectVersionMetadata.mavenFacet=new MavenFacet(data.facetList.packaging,data.facetList.parent);
}
}
}
@ -528,8 +539,12 @@ $(function() {
return null;
}
MavenFacet=function(packaging){
MavenFacet=function(packaging,parent){
this.packaging=packaging;
if(parent){
this.parent={groupId:parent.groupId,artifactId:parent.artifactId,version:parent.version};
}
}
ProjectVersionMetadata=function(id,url,name,description,organization,issueManagement,scm,ciManagement,licenses,

View File

@ -445,6 +445,21 @@
<th>${$.i18n.prop('browse.artifact.version')}</th>
<td>${version}</td>
</tr>
<tr>
<th>${$.i18n.prop('browse.artifact.packaging')}</th>
<td>${projectVersionMetadata.mavenFacet.packaging}</td>
</tr>
{{if projectVersionMetadata.mavenFacet.parent }}
<tr>
<th>${$.i18n.prop('browse.artifact.parent')}</th>
<td>
<a href="#" data-bind="click: displayParent">
${projectVersionMetadata.mavenFacet.parent.groupId}:${projectVersionMetadata.mavenFacet.parent.artifactId}:${projectVersionMetadata.mavenFacet.parent.version}
</a>
</td>
</tr>
{{/if}}
</tbody>
</table>
</div>