aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2012-09-23 23:22:00 +0000
committerOlivier Lamy <olamy@apache.org>2012-09-23 23:22:00 +0000
commit8f9d0d3e003cd0c5c8f2e813522273301cdfe00e (patch)
treec8f88dd2149f7bc71f71869f467188a9fd48000a /archiva-modules
parent890e111d5c7a9a0fba43a96e8ac52eb53d4fdec2 (diff)
downloadarchiva-8f9d0d3e003cd0c5c8f2e813522273301cdfe00e.tar.gz
archiva-8f9d0d3e003cd0c5c8f2e813522273301cdfe00e.zip
add repo feeds link in managed repositories table
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1389166 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules')
-rw-r--r--archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties3
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repositories.js156
-rw-r--r--archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/templates/archiva/repositories.html5
3 files changed, 92 insertions, 72 deletions
diff --git a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
index 13ac4dd53..0ea324242 100644
--- a/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
+++ b/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
@@ -106,7 +106,8 @@ managedrepository.merge.conflicts.header=Merging {0} to {1}
managedrepository.merge.conflicts=Merge has {0} conflicts
managedrepository.merge.domerge=Merge
managedrepository.merge.domerge.skipconflicts=Merge with skipping conflicts
-
+managed.repository.rss.header=Feeds
+managedpository.feeds=Feeds for
# remote repositories screen
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 5ce3b025b..8fd0b496e 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){
+ skipPackedIndexCreation,feedsUrl){
var self=this;
@@ -103,6 +103,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
this.skipPackedIndexCreation=ko.observable(skipPackedIndexCreation?skipPackedIndexCreation:false);
this.skipPackedIndexCreation.subscribe(function(newValue){self.modified(true)});
+ this.feedsUrl=feedsUrl;
this.getTypeLabel=function(){
for(var i=0;i<window.managedRepositoryTypes.length;i++){
@@ -149,9 +150,11 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
this.lastScanDate=ko.observable(lastScanDate);
}
- mapManagedRepositories=function(data){
+ mapManagedRepositories=function(data,applicationUrl){
var mappedManagedRepositories = $.map(data, function(item) {
- return mapManagedRepository(item);
+ var managedRepository = mapManagedRepository(item);
+ managedRepository.feedsUrl=applicationUrl+"/feeds/"+managedRepository.id();
+ return managedRepository;
});
return mappedManagedRepositories;
}
@@ -818,6 +821,7 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
RemoteRepositoriesViewModel=function(){
this.remoteRepositories=ko.observableArray([]);
+ this.applicationUrl=null;
this.gridViewModel = null;
var self = this;
@@ -991,75 +995,87 @@ define("archiva.repositories",["jquery","i18n","jquery.tmpl","bootstrap","jquery
var managedRepositoriesViewModel = new ManagedRepositoriesViewModel();
var remoteRepositoriesViewModel = new RemoteRepositoriesViewModel();
- loadManagedRepositories(function(data) {
- managedRepositoriesViewModel.managedRepositories(mapManagedRepositories(data));
- managedRepositoriesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
- data: managedRepositoriesViewModel.managedRepositories,
- columns: [
- {
- headerText: $.i18n.prop('identifier'),
- rowText: "id"
- },
- {
- headerText: $.i18n.prop('name'),
- rowText: "name"
- },
- {
- headerText: $.i18n.prop('type'),
- rowText: "getTypeLabel",
- // FIXME i18n
- title: "Repository type (default is Maven 2)"
- }
- ],
- pageSize: 5,
- gridUpdateCallBack: function(){
- $("#main-content" ).find("#managed-repositories-table").find("[title]").tooltip();
- }
- });
- var mainContent = $("#main-content");
- ko.applyBindings(managedRepositoriesViewModel,mainContent.find("#managed-repositories-view").get(0));
- activatePopoverDoc();
- mainContent.find("#managed-repositories-pills #managed-repositories-view-a").tab('show');
- removeMediumSpinnerImg("#main-content #managed-repositories-content");
- activateManagedRepositoriesGridTab();
- });
+ $.ajax({
+ url: "restServices/archivaServices/archivaAdministrationService/applicationUrl",
+ type: "GET",
+ dataType: 'text',
+ success: function(applicationUrl){
+ $.log("applicationUrl:"+applicationUrl);
+ loadManagedRepositories(function(data) {
- loadRemoteRepositories(function(data) {
- remoteRepositoriesViewModel.remoteRepositories(mapRemoteRepositories(data));
- remoteRepositoriesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
- data: remoteRepositoriesViewModel.remoteRepositories,
- columns: [
- {
- headerText: $.i18n.prop('identifier'),
- rowText: "id"
- },
- {
- headerText: $.i18n.prop('name'),
- rowText: "name"
- },
- {
- headerText: $.i18n.prop('url'),
- rowText: "url"
- },
- {
- headerText: $.i18n.prop('type'),
- rowText: "getTypeLabel",
- // FIXME i18n
- title: "Repository type (default is Maven 2)"
- }
- ],
- pageSize: 5,
- gridUpdateCallBack: function(){
- $("#main-content" ).find("#remote-repositories-table").find("[title]").tooltip();
- }
- });
- var mainContent = $("#main-content");
- ko.applyBindings(remoteRepositoriesViewModel,mainContent.find("#remote-repositories-view").get(0));
- mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show')
- removeMediumSpinnerImg("#main-content #remote-repositories-content");
- activatePopoverDoc();
- });
+ managedRepositoriesViewModel.managedRepositories(
+ mapManagedRepositories(data,applicationUrl?applicationUrl:window.location.toString().substringBeforeLast("/")));
+
+ managedRepositoriesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
+ data: managedRepositoriesViewModel.managedRepositories,
+ columns: [
+ {
+ headerText: $.i18n.prop('identifier'),
+ rowText: "id"
+ },
+ {
+ headerText: $.i18n.prop('name'),
+ rowText: "name"
+ },
+ {
+ headerText: $.i18n.prop('type'),
+ rowText: "getTypeLabel",
+ // FIXME i18n
+ title: "Repository type (default is Maven 2)"
+ }
+ ],
+ pageSize: 5,
+ gridUpdateCallBack: function(){
+ $("#main-content" ).find("#managed-repositories-table").find("[title]").tooltip();
+ }
+ });
+ var mainContent = $("#main-content");
+ ko.applyBindings(managedRepositoriesViewModel,mainContent.find("#managed-repositories-view").get(0));
+ activatePopoverDoc();
+ mainContent.find("#managed-repositories-pills #managed-repositories-view-a").tab('show');
+ removeMediumSpinnerImg("#main-content #managed-repositories-content");
+ activateManagedRepositoriesGridTab();
+ });
+
+ loadRemoteRepositories(function(data) {
+ remoteRepositoriesViewModel.remoteRepositories(mapRemoteRepositories(data));
+ remoteRepositoriesViewModel.gridViewModel = new ko.simpleGrid.viewModel({
+ data: remoteRepositoriesViewModel.remoteRepositories,
+ columns: [
+ {
+ headerText: $.i18n.prop('identifier'),
+ rowText: "id"
+ },
+ {
+ headerText: $.i18n.prop('name'),
+ rowText: "name"
+ },
+ {
+ headerText: $.i18n.prop('url'),
+ rowText: "url"
+ },
+ {
+ headerText: $.i18n.prop('type'),
+ rowText: "getTypeLabel",
+ // FIXME i18n
+ title: "Repository type (default is Maven 2)"
+ }
+ ],
+ pageSize: 5,
+ gridUpdateCallBack: function(){
+ $("#main-content" ).find("#remote-repositories-table").find("[title]").tooltip();
+ }
+ });
+ var mainContent = $("#main-content");
+ ko.applyBindings(remoteRepositoriesViewModel,mainContent.find("#remote-repositories-view").get(0));
+ mainContent.find("#remote-repositories-pills #remote-repositories-view-a").tab('show')
+ removeMediumSpinnerImg("#main-content #remote-repositories-content");
+ activatePopoverDoc();
+ });
+ }
+ }
+ );
mainContent.find("#managed-repositories-pills").on('show', function (e) {
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 44f9b9e6d..751e63db1 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
@@ -92,7 +92,7 @@
<th>${$.i18n.prop('delete')}</th>
<th>${$.i18n.prop('modified')}</th>
<!--th>${$.i18n.prop('description')}</th-->
-
+ <th>${$.i18n.prop('managed.repository.rss.header')}</th>
<th title="${$.i18n.prop('managedrepository.stats')}">${$.i18n.prop('managedrepository.stats.grid.header')}</th>
<!--th title="${$.i18n.prop('managedrepository.scan.directories')}">${$.i18n.prop('managedrepository.scan.directories.grid.header')}</th-->
</tr>
@@ -184,6 +184,9 @@
{{else}}
<td></td>
{{/if}}
+ <td>
+ <a href="${row.feedsUrl}"><img src="images/atom.gif" alt="" title="${$.i18n.prop('managedpository.feeds')} ${row.name()}"/></a>
+ </td>
<!--td>
{{if row.description()}}
<a class="btn btn-warning btn-mini popover-doc" id="managedrepo-description-help"