From c51bba95bbd717f9201ec510bf5c745f3ca44061 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Fri, 23 Mar 2012 14:16:25 +0000 Subject: [PATCH] link to go from results view to details groupId, artifact or artifactDetails git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1304364 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/webapp/js/archiva/search.js | 28 +++++++++++++++++++ .../webapp/js/archiva/templates/search.html | 12 ++++---- 2 files changed, 34 insertions(+), 6 deletions(-) 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 8dc383f42..3757d8be6 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 @@ -1025,6 +1025,34 @@ $(function() { applyAutocompleteOnHeader('classifier',self); } }); + + groupIdView=function(artifact){ + $.log("groupIdView:"+artifact.groupId); + displayBrowseGroupId(artifact.groupId); + } + artifactIdView=function(artifact){ + $.log("artifactIdView:"+artifact.groupId); + displayBrowseArtifactDetail(artifact.groupId,artifact.artifactId,null,null); + } + artifactDetailView=function(artifact){ + $.log("artifactDetailView:"+artifact.groupId); + var mainContent=$("#main-content"); + mainContent.html($("#browse-tmpl" ).tmpl()); + mainContent.find("#browse_result" ).hide(); + mainContent.find("#browse_artifact_detail").show(); + mainContent.find("#browse_artifact_detail").html(mediumSpinnerImg()); + mainContent.find("#browse_breadcrumb" ).show(); + mainContent.find("#browse_breadcrumb" ).html(mediumSpinnerImg()); + $.ajax("restServices/archivaServices/browseService/userRepositories", { + type: "GET", + dataType: 'json', + success: function(data) { + mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:null})); + var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(artifact.groupId,artifact.artifactId,artifact.version); + artifactVersionDetailViewModel.display(true); + } + }); + } } diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html index e8e2c4ce6..2bfa8a931 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/search.html @@ -397,12 +397,12 @@ {{each(i, row) itemsOnCurrentPage()}} - - ${row.groupId} - ${row.artifactId} - ${row.version} - ${row.classifier} - + + ${row.groupId} + ${row.artifactId} + ${row.version} + ${row.classifier} + {{/each}}