aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-23 23:22:43 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-23 23:22:43 +0000
commit733959a02a5c14bbbcc403000f1708deeaef169a (patch)
tree165f80ad55d4a5e1543580e3b47c4a672e3decc2
parent13d77f3b0716ae22d924d9494a232e280657b347 (diff)
downloadarchiva-733959a02a5c14bbbcc403000f1708deeaef169a.tar.gz
archiva-733959a02a5c14bbbcc403000f1708deeaef169a.zip
rss link when browsing an artifact
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1389170 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js15
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/search.html2
2 files changed, 11 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 14a26528a..74473ed77 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
@@ -23,12 +23,13 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
// browse part
//-----------------------------------------
- BrowseViewModel=function(browseResultEntries,parentBrowseViewModel,groupId,repositoryId){
+ BrowseViewModel=function(browseResultEntries,parentBrowseViewModel,groupId,repositoryId,feedsUrl){
var self=this;
this.browseResultEntries=browseResultEntries;
this.parentBrowseViewModel=parentBrowseViewModel;
this.groupId=groupId;
this.repositoryId=repositoryId;
+ this.feedsUrl=feedsUrl;
displayGroupId=function(groupId){
$.log("BrowseViewModel#displayGroupId,self.repositoryId:"+self.repositoryId);
if(self.repositoryId){
@@ -143,7 +144,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
return breadCrumbEntries;
}
- displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl,repositoryId){
+ displayGroupDetail=function(groupId,parentBrowseViewModel,restUrl,repositoryId,feedsUrl){
var mainContent = $("#main-content");
mainContent.find("#browse_artifact_detail").hide();
var browseResult=mainContent.find("#browse_result");
@@ -171,7 +172,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
dataType: 'json',
success: function(data) {
var browseResultEntries = mapBrowseResultEntries(data);
- var browseViewModel = new BrowseViewModel(browseResultEntries,parentBrowseViewModel,groupId,repositoryId);
+ var browseViewModel = new BrowseViewModel(browseResultEntries,parentBrowseViewModel,groupId,repositoryId,feedsUrl);
ko.applyBindings(browseViewModel,browseBreadCrumb.get(0));
ko.applyBindings(browseViewModel,browseResult.get(0));
enableAutocompleBrowse(groupId);
@@ -799,17 +800,19 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
mainContent.find("#browse_result").html(mediumSpinnerImg());
var parentBrowseViewModel=new BrowseViewModel(null,null,null,repositoryId);
var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
+ var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/");
if (repositoryId){
url+="?repositoryId="+repositoryId;
// we are browsing a groupId so 2 substringBeforeLast
- var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/");
+
feedsUrl+="/feeds/"+repositoryId;
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" )
.tmpl({repositories:data,selected:repositoryId,feedsUrl:feedsUrl}));
}else{
- mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:""}));
+ mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" )
+ .tmpl({repositories:data,selected:"",feedsUrl:null}));
}
- displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId);
+ displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId,feedsUrl);
}
});
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 1f4cf576b..ce9956068 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
@@ -42,6 +42,7 @@
<script id="browse-groups-tmpl" type="text/html">
<div>
<ul>
+
<!-- if null we are on root level -->
{{if $root.parentBrowseViewModel}}
<li class="browse-list" data-bind="click:function(){displayParentGroupId()}">
@@ -58,6 +59,7 @@
{{else}}
<li class="browse-list-project">
<a href="#" data-bind="click:function(){displayProjectEntry(browseResultEntry.name)}">${displayEntry(browseResultEntry.name)}</a>
+ <a href="${$root.feedsUrl}/${$root.groupId}/${browseResultEntry.name}"><img src="images/atom.gif"></img></a>
</li>
{{/if}}
{{else}}