]> source.dussan.org Git - archiva.git/commitdiff
link to view artifact parent
authorOlivier Lamy <olamy@apache.org>
Mon, 19 Mar 2012 22:47:11 +0000 (22:47 +0000)
committerOlivier Lamy <olamy@apache.org>
Mon, 19 Mar 2012 22:47:11 +0000 (22:47 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1302701 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html

index c1b5524f490c82b325c75b2b6d330930f4e5ca5d..f340e33bced06d67c15b0d61705bd3628c01a4f8 100644 (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,
index 7eed22d9d26593cfc82c674f92a1e367043b95fe..cee3ea280e6200af51e05db7cd25107ca7d1723a 100644 (file)
               <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>