[MRM-1615] Artifact detail view

dependencies: display crumb

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1303362 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-03-21 11:14:44 +00:00
parent 807d29a1e1
commit 9ceb3ff84b
3 changed files with 37 additions and 9 deletions

View File

@ -270,6 +270,7 @@ browse.artifact.scm=SCM
browse.artifact.scm.connection=Connection browse.artifact.scm.connection=Connection
browse.artifact.scm.devconnection=Dev. Connection browse.artifact.scm.devconnection=Dev. Connection
browse.artifact.scm.viewer=Viewer browse.artifact.scm.viewer=Viewer
browse.artifact.scope=Scope
#login #login
login.username.placehoder=Username login.username.placehoder=Username

View File

@ -75,7 +75,6 @@ $(function() {
for (var i=0;i<splitted.length;i++){ for (var i=0;i<splitted.length;i++){
curGroupId+=splitted[i]; curGroupId+=splitted[i];
breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i])); breadCrumbEntries.push(new BreadCrumbEntry(curGroupId,splitted[i]));
$.log("calculateBreadCrumbEntries:"+curGroupId+":"+splitted[i]);
curGroupId+="." curGroupId+="."
} }
return breadCrumbEntries; return breadCrumbEntries;
@ -177,6 +176,7 @@ $(function() {
entries.push(new BreadCrumbEntry("foo",self.version)); entries.push(new BreadCrumbEntry("foo",self.version));
return entries; return entries;
} }
this.display=function(){ this.display=function(){
mainContent.find("#browse_breadcrumb").hide("slide", {}, 300,function(){ mainContent.find("#browse_breadcrumb").hide("slide", {}, 300,function(){
mainContent.find("#browse_artifact").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){ Dependency=function(classifier,optional,scope,systemPath,type,artifactId,groupId,version){
var self=this;
//private String classifier; //private String classifier;
this.classifier=classifier; this.classifier=classifier;
@ -674,6 +675,20 @@ $(function() {
//private String version; //private String version;
this.version=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;
}
} }
//----------------------------------------- //-----------------------------------------

View File

@ -577,7 +577,19 @@
<th>${dependency.artifactId}</th> <th>${dependency.artifactId}</th>
</tr> </tr>
<tr> <tr>
<td>${dependency.groupId},${dependency.artifactId},${dependency.version}</td> <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> </tr>
{{/each}} {{/each}}
</tbody> </tbody>