]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1615] Artifact detail view
authorOlivier Lamy <olamy@apache.org>
Wed, 21 Mar 2012 11:14:44 +0000 (11:14 +0000)
committerOlivier Lamy <olamy@apache.org>
Wed, 21 Mar 2012 11:14:44 +0000 (11:14 +0000)
dependencies: display crumb

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1303362 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
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 587232a7fa5bc6cd795f7efd041866b1b80ec1ec..52fc346ab855a33f4bf083df611fa94d2e7cdf2b 100644 (file)
@@ -270,6 +270,7 @@ browse.artifact.scm=SCM
 browse.artifact.scm.connection=Connection
 browse.artifact.scm.devconnection=Dev. Connection
 browse.artifact.scm.viewer=Viewer
+browse.artifact.scope=Scope
 
 #login
 login.username.placehoder=Username
index baa2cccbc64e0d0de8572b4b661edae2b0c1aca5..524962a1249e2336ddc598d7e525e976a7cd00ad 100644 (file)
@@ -75,7 +75,6 @@ $(function() {
     for (var i=0;i<splitted.length;i++){
       curGroupId+=splitted[i];
       breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i]));
-      $.log("calculateBreadCrumbEntries:"+curGroupId+":"+splitted[i]);
       curGroupId+="."
     }
     return breadCrumbEntries;
@@ -177,6 +176,7 @@ $(function() {
       entries.push(new BreadCrumbEntry("foo",self.version));
       return entries;
     }
+
     this.display=function(){
       mainContent.find("#browse_breadcrumb").hide("slide", {}, 300,function(){
         mainContent.find("#browse_artifact").hide("slide", {}, 300,function(){
@@ -650,6 +650,7 @@ $(function() {
   }
 
   Dependency=function(classifier,optional,scope,systemPath,type,artifactId,groupId,version){
+    var self=this;
     //private String classifier;
     this.classifier=classifier;
 
@@ -674,6 +675,20 @@ $(function() {
     //private String version;
     this.version=version;
 
+    this.crumbEntries=function(){
+      $.log("Dependency#calculateCrumbEntries");
+      var splitted = self.groupId.split(".");
+      var breadCrumbEntries=[];
+      var curGroupId="";
+      for (var i=0;i<splitted.length;i++){
+        curGroupId+=splitted[i];
+        breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i]));
+        curGroupId+="."
+      }
+      breadCrumbEntries.push(new BreadCrumbEntry(self.artifactId,self.artifactId));
+      return breadCrumbEntries;
+    }
+
   }
 
   //-----------------------------------------
index 245d684bd0468b3af11c463422e76a197a3c67ae..d76c06cb3773cba63fa9d55caada2f3489c50cc2 100644 (file)
          <div id="artifact-details-dependencies-content" class="tab-pane">
         <table class="table">
           <tbody>
-        {{each(i,dependency) projectVersionMetadata.dependencies}}
-          <tr>
-            <th>${dependency.artifactId}</th>
-          </tr>
-          <tr>
-            <td>${dependency.groupId},${dependency.artifactId},${dependency.version}</td>
-          </tr>
-        {{/each}}
+          {{each(i,dependency) projectVersionMetadata.dependencies}}
+            <tr>
+              <th>${dependency.artifactId}</th>
+            </tr>
+            <tr>
+              <td>
+                {{var entries=dependency.crumbEntries()}}
+                {{each(j,crumbEntry) entries}}
+                  ${crumbEntry.displayValue}
+                  {{if j < entries.length - 1}}
+                     &nbsp;/&nbsp;
+                  {{/if}}
+                {{/each}}
+                &nbsp;|&nbsp;<b>${$.i18n.prop('browse.artifact.version')}:</b>&nbsp;${dependency.version}&nbsp;
+                {{if dependency.scope}}
+                  |&nbsp;<b>${$.i18n.prop('browse.artifact.scope')}:</b>&nbsp;${dependency.scope}
+                {{/if}}
+              </td>
+            </tr>
+          {{/each}}
           </tbody>
         </table>
          </div>