aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-25 21:17:24 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-25 21:17:24 +0000
commit3163bbd09a92d1be2f85d01b8581c9b0cb10a806 (patch)
tree4de4080c4b9211c7f709ee3c37f236d0ea9df930 /archiva-modules
parent3d0e7062fcd30903a42dab48d6597f10c01cb140 (diff)
downloadarchiva-3163bbd09a92d1be2f85d01b8581c9b0cb10a806.tar.gz
archiva-3163bbd09a92d1be2f85d01b8581c9b0cb10a806.zip
fix url display in repository groups definition page
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1390147 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js5
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js75
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html4
3 files changed, 48 insertions, 36 deletions
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
index 8fd0b496e..99c2e73c3 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js
@@ -34,7 +34,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
ManagedRepository=function(id,name,layout,indexDirectory,location,snapshots,releases,blockRedeployments,cronExpression,
scanned,daysOlder,retentionCount,deleteReleasedSnapshots,stageRepoNeeded,description,
- skipPackedIndexCreation,feedsUrl){
+ skipPackedIndexCreation,feedsUrl,url){
var self=this;
@@ -105,6 +105,8 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
this.feedsUrl=feedsUrl;
+ this.url=url;
+
this.getTypeLabel=function(){
for(var i=0;i<window.managedRepositoryTypes.length;i++){
if (window.managedRepositoryTypes[i].type==self.layout()){
@@ -154,6 +156,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
var mappedManagedRepositories = $.map(data, function(item) {
var managedRepository = mapManagedRepository(item);
managedRepository.feedsUrl=applicationUrl+"/feeds/"+managedRepository.id();
+ managedRepository.url=applicationUrl+"/repository/"+managedRepository.id()
return managedRepository;
});
return mappedManagedRepositories;
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
index 9744d4f4d..651671cfd 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
@@ -177,44 +177,53 @@ function() {
var self=this;
loadManagedRepositories(function(data) {
- self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data));
- $.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", {
+ $.ajax({
+ url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
type: "GET",
- dataType: 'json',
- success: function(data) {
- var mappedRepositoryGroups=mapRepositoryGroups(data);
- for(var i=0;i<mappedRepositoryGroups.length;i++){
- mappedRepositoryGroups[i]
- .managedRepositories(self.mapManagedRepositoriesToRepositoryGroup(mappedRepositoryGroups[i]));
- mappedRepositoryGroups[i].modified(false);
- $.log("mappedRepositoryGroups.repositories().length:"+mappedRepositoryGroups[i].repositories().length);
- }
- mainContent.html($("#repositoryGroupsMain").tmpl());
- self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups);
- $.log("displayRepositoryGroups#applyBindings before");
- ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0));
- $.log("displayRepositoryGroups#applyBindings after");
-
-
- mainContent.find("#repository-groups-view-tabs").on('show', function (e) {
- if ($(e.target).attr("href")=="#repository-groups-edit") {
- var repositoryGroup = new RepositoryGroup();
- var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel);
- activateRepositoryGroupEditTab();
- ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0));
- }
- if ($(e.target).attr("href")=="#repository-groups-view") {
- mainContent.find("#repository-groups-view-tabs-li-edit a").html($.i18n.prop("add"));
- clearUserMessages();
+ dataType: 'text',
+ success: function(applicationUrl){
+
+ self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data,applicationUrl));
+
+ $.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups", {
+ type: "GET",
+ dataType: 'json',
+ success: function(data) {
+ var mappedRepositoryGroups=mapRepositoryGroups(data);
+ for(var i=0;i<mappedRepositoryGroups.length;i++){
+ mappedRepositoryGroups[i]
+ .managedRepositories(self.mapManagedRepositoriesToRepositoryGroup(mappedRepositoryGroups[i]));
+ mappedRepositoryGroups[i].modified(false);
+ $.log("mappedRepositoryGroups.repositories().length:"+mappedRepositoryGroups[i].repositories().length);
+ }
+ mainContent.html($("#repositoryGroupsMain").tmpl());
+ self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups);
+ $.log("displayRepositoryGroups#applyBindings before");
+ ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view" ).get(0));
+ $.log("displayRepositoryGroups#applyBindings after");
+
+
+ mainContent.find("#repository-groups-view-tabs").on('show', function (e) {
+ if ($(e.target).attr("href")=="#repository-groups-edit") {
+ var repositoryGroup = new RepositoryGroup();
+ var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,false,self.repositoryGroupsViewModel);
+ activateRepositoryGroupEditTab();
+ ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-edit" ).get(0));
+ }
+ if ($(e.target).attr("href")=="#repository-groups-view") {
+ mainContent.find("#repository-groups-view-tabs-li-edit a").html($.i18n.prop("add"));
+ clearUserMessages();
+ }
+
+ });
+
+ }
}
-
- });
+ );
}
- }
- );
-
+ });
});
this.mapManagedRepositoriesToRepositoryGroup=function(repositoryGroup){
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html
index 751e63db1..0aba8e2f2 100644
--- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html
+++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html
@@ -1181,8 +1181,8 @@
<br/>
${$data.name()}
<br/>
- <a href="${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}" target="_blank">
- ${window.archivaRuntimeInfo.baseUrl}/repository/${$data.id()}
+ <a href="${$data.url}" target="_blank">
+ ${$data.url}
</a>
<br/>
</blockquote>