make browsing artifact content navigable.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1378029 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-08-28 09:07:49 +00:00
parent de4a2d210a
commit fc50439f7f
4 changed files with 45 additions and 9 deletions

View File

@ -81,7 +81,10 @@
}
.browse-list-project{
list-style-image: url("../images/folder-saved-search.png");
}
.package-list{
list-style-image: url("../images/package-x-generic.png");
}
.force-upper-case{

View File

@ -311,10 +311,11 @@ function(jquery,ui,sammy,tmpl) {
var checkArtifactDetailContent=function(groupId,artifactId,version,repositoryId,tabToActivate,idContentToCheck,contentDisplayFn){
// no need to recalculate all stuff just activate the tab
var htmlId = idContentToCheck?idContentToCheck:"browse_artifact_detail";
var htmlIdSelect = $("#main-content #"+htmlId );
var htmlIdSelect = $("#main-content").find("#"+htmlId );
if(htmlIdSelect.html()!=null){
if( $.trim(htmlIdSelect.html().length)>0){
$("#main-content #"+tabToActivate).tab('show');
$.log("checkArtifactDetailContent " + htmlId + " html not empty no calculation");
return;
}
}
@ -365,6 +366,33 @@ function(jquery,ui,sammy,tmpl) {
checkArtifactDetailContent(groupId,artifactId,version,repositoryId,"artifact-details-dependencies-content-a");
});
this.get('#artifact-details-files-content/:groupId/:artifactId/:version',function(context){
var repositoryId = this.params.repositoryId;
var groupId= this.params.groupId;
var artifactId= this.params.artifactId;
var version= this.params.version;
checkArtifactDetailContent(groupId,artifactId,version,null,"artifact-details-files-content-a","artifact-details-files-content",
function(groupId,artifactId,version,artifactVersionDetailViewModel){
displayArtifactFilesContent(artifactVersionDetailViewModel);
});
});
this.get('#artifact-details-files-content~:repositoryId/:groupId/:artifactId/:version',function(context){
var repositoryId = this.params.repositoryId;
var groupId= this.params.groupId;
var artifactId= this.params.artifactId;
var version= this.params.version;
checkArtifactDetailContent(groupId,artifactId,version,repositoryId,"artifact-details-files-content-a","artifact-details-files-content",
function(groupId,artifactId,version,artifactVersionDetailViewModel){
displayArtifactFilesContent(artifactVersionDetailViewModel);
});
});
this.get('#artifact-dependency-tree/:groupId/:artifactId/:version',function(context){

View File

@ -341,7 +341,15 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
return;
}
if ($(e.target).attr("href")=="#artifact-details-files-content") {
displayArtifactFilesContent(self);
//displayArtifactFilesContent(self);
var location ="#artifact-details-files-content";
if (self.repositoryId){
location+="~"+self.repositoryId;
}
location+="/"+self.groupId+"/"+self.artifactId+"/"+self.version;
window.sammyArchivaApplication.setLocation(location);
return;
}
});
if(afterCallbackFn){

View File

@ -638,14 +638,11 @@
</table>
</div>
<div id="artifact-details-dependency-tree-content" class="tab-pane">
</div>
<div id="artifact-details-dependency-tree-content" class="tab-pane"></div>
<div id="artifact-details-files-content" class="tab-pane">
</div>
<div id="artifact-details-files-content" class="tab-pane"></div>
<div id="artifact-details-download-content" class="tab-pane">
</div>
<div id="artifact-details-download-content" class="tab-pane"></div>
<div id="artifact-details-used-by-content" class="tab-pane"></div>
@ -825,7 +822,7 @@
<script id="artifact-details-files-content_tmpl" type="text/html">
<div class="row-fluid">
<div class="span5">
<ul id="artifact-content-list-files">
<ul id="artifact-content-list-files" class="package-list">
{{each artifactDownloadInfos}}
<li id="${$value.classifier}:${$value.version}:${$value.packaging}">
<a href="#">${$value.packaging}:${$value.version}&nbsp;-&nbsp;${$value.size}</a>