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

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1303363 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 524962a1249e2336ddc598d7e525e976a7cd00ad..aaa16f53e58578819ca4d0fc913e84f466f1fe16 100644 (file)
@@ -215,6 +215,20 @@ $(function() {
         });
       });
     }
+
+    displayGroup=function(groupId){
+      var parentBrowseViewModel=new BrowseViewModel(null,null,null);
+      displayGroupDetail(groupId,parentBrowseViewModel,null);
+    }
+
+    displayArtifactDetailView=function(groupId, artifactId){
+      displayArtifactDetail(groupId, artifactId);
+    }
+
+    displayArtifactVersionDetailViewModel=function(groupId,artifactId,version){
+      var artifactVersionDetailViewModel = new ArtifactVersionDetailViewModel (groupId,artifactId,version)
+      artifactVersionDetailViewModel.display();
+    }
   }
 
   displayArtifactDetail=function(groupId,artifactId,parentBrowseViewModel,restUrl){
@@ -466,6 +480,7 @@ $(function() {
     this.displayValue=displayValue;
     this.artifactId=null;
     this.artifact=false;
+    this.version=null;
   }
   mapVersionsList=function(data){
     if (data){
@@ -682,10 +697,21 @@ $(function() {
       var curGroupId="";
       for (var i=0;i<splitted.length;i++){
         curGroupId+=splitted[i];
+        $.log("splitted[i]:"+i+":"+splitted[i]);
         breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i]));
         curGroupId+="."
       }
-      breadCrumbEntries.push(new BreadCrumbEntry(self.artifactId,self.artifactId));
+      var crumbEntryArtifact=new BreadCrumbEntry(self.groupId,self.artifactId);
+      crumbEntryArtifact.artifactId=self.artifactId;
+      crumbEntryArtifact.artifact=true;
+      breadCrumbEntries.push(crumbEntryArtifact);
+
+      var crumbEntryVersion=new BreadCrumbEntry(self.groupId,self.version);
+      crumbEntryVersion.artifactId=self.artifactId;
+      crumbEntryVersion.artifact=false;
+      crumbEntryVersion.version=self.version;
+      breadCrumbEntries.push(crumbEntryVersion);
+
       return breadCrumbEntries;
     }
 
index d76c06cb3773cba63fa9d55caada2f3489c50cc2..c0331cc0bf307daaf0e163c4cb8630c0abed75c2 100644 (file)
               <td>
                 {{var entries=dependency.crumbEntries()}}
                 {{each(j,crumbEntry) entries}}
-                  ${crumbEntry.displayValue}
-                  {{if j < entries.length - 1}}
+                  {{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}}
+                    &nbsp;|&nbsp;<b>${$.i18n.prop('browse.artifact.version')}:</b>&nbsp;
+                     <a href="#" data-bind="click: function(){displayArtifactVersionDetailViewModel(crumbEntry.groupId,crumbEntry.artifactId,crumbEntry.version)}">${dependency.version}</a>&nbsp;
+                  {{/if}}
+                  {{if j < entries.length - 2}}
                      &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}}