feeds url at repository level when browsing

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1389168 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Olivier Lamy 2012-09-23 23:22:27 +00:00
parent 7218e1c44e
commit 13d77f3b07
2 changed files with 124 additions and 67 deletions

View File

@ -787,6 +787,13 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
$.log("displayBrowseGroupId:"+groupId+":"+repositoryId);
userRepositoriesCall(
function(data){
$.ajax({
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
type: "GET",
dataType: 'text',
success: function(applicationUrl){
var mainContent = $("#main-content");
mainContent.html($("#browse-tmpl" ).tmpl());
mainContent.find("#browse_result").html(mediumSpinnerImg());
@ -794,11 +801,19 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
var url="restServices/archivaServices/browseService/browseGroupId/"+encodeURIComponent(groupId);
if (repositoryId){
url+="?repositoryId="+repositoryId;
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected: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:""}));
}
displayGroupDetail(groupId,parentBrowseViewModel,url,repositoryId);
}
});
}
);
@ -832,10 +847,23 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
userRepositoriesCall(
function(data){
$.ajax({
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
type: "GET",
dataType: 'text',
success: function(applicationUrl){
var feedsUrl=applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/").substringBeforeLast("/");
feedsUrl+="/feeds/"+repositoryId;
if(repositoryId){
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected: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}));
}
mainContent.find("#browse_artifact_detail" ).hide();
@ -869,7 +897,7 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
}
});
});
}})
});
}
@ -902,7 +930,19 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
userRepositoriesCall(
function(data) {
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
$.ajax({
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
type: "GET",
dataType: 'text',
success: function(applicationUrl){
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}));
var url="restServices/archivaServices/browseService/rootGroups";
if(repositoryId){
url+="?repositoryId="+repositoryId;
@ -919,6 +959,10 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
enableAutocompleBrowse();
}
});
}}
)
}
)
@ -1601,9 +1645,19 @@ define("archiva.search",["jquery","i18n","jquery.tmpl","choosen","knockout","kno
userRepositoriesCall(
function(data) {
mainContent.find("#selected_repository" ).html($("#selected_repository_tmpl" ).tmpl({repositories:data,selected:repositoryId}));
$.ajax({
url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
type: "GET",
dataType: 'text',
success: function(applicationUrl){
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}));
var artifactVersionDetailViewModel=new ArtifactVersionDetailViewModel(groupId,artifactId,version,repositoryId);
artifactVersionDetailViewModel.display(afterCallbackFn);
}})
}
);

View File

@ -437,6 +437,9 @@
{{/if}}
{{/each}}
</select>
{{if selected && feedsUrl}}
<a href="${feedsUrl}"><img src="images/atom.gif"/></a>
{{/if}}
</script>
<script id="browse-artifact-detail-tmpl" type="text/html">