aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-08-28 09:07:49 +0000
committerOlivier Lamy <olamy@apache.org>2012-08-28 09:07:49 +0000
commitfc50439f7f66f229c49fc757f66aff8cdd0e0307 (patch)
tree5a8a0236d40a67c9cd793ebe0d922b5a882f2629
parentde4a2d210a928e488c91f1af9ba532163c4cbb2b (diff)
downloadarchiva-fc50439f7f66f229c49fc757f66aff8cdd0e0307.tar.gz
archiva-fc50439f7f66f229c49fc757f66aff8cdd0e0307.zip
make browsing artifact content navigable.
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1378029 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js30
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js10
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html11
4 files changed, 45 insertions, 9 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css
index e14681631..f145eb09f 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css
@@ -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{
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
index 0dc0da9bc..b55de7d8d 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
@@ -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){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
index 12391a106..880b12a89 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
@@ -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){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
index 5761389b4..821a7f00d 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html
@@ -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>