]> source.dussan.org Git - archiva.git/commitdiff
make browsing artifact content navigable.
authorOlivier Lamy <olamy@apache.org>
Tue, 28 Aug 2012 09:07:49 +0000 (09:07 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 28 Aug 2012 09:07:49 +0000 (09:07 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1378029 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main.js
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/templates/archiva/search.html

index e14681631bfd9ca935736f7aa3e57391961e9705..f145eb09f4abe1296f06cd24fc64b697a95e52ff 100644 (file)
 }
 .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{
index 0dc0da9bc823cc34b10a00bd76e21f0fa2880803..b55de7d8dcdd5893c95b2e049d3fd396af80a285 100644 (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){
 
index 12391a10698065cf2a6e5459a2f750b6298e58db..880b12a893565dec4462fce6cc30a4264ecc2136 100644 (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){
index 5761389b444d98c6b2f787c92d9e5e4586171a5c..821a7f00df3be485fb34b692d82b092fbd882d4a 100644 (file)
         </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>
 
 <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>