[MRM-1615] Artifact detail view

dependencies: link to detail for dependencies.

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

View 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;
}

View File

@ -580,12 +580,19 @@
<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}}