From: Olivier Lamy Date: Mon, 13 Feb 2012 13:56:21 +0000 (+0000) Subject: [MRM-1576] rewrite proxies connector page X-Git-Tag: archiva-1.4-M3~1307 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=f5f776388170f7062b6eb2c1e624af0f3429493d;p=archiva.git [MRM-1576] rewrite proxies connector page magnify :-) remote repository ordering git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1243514 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css index ef2c891d4..9a556f95f 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/css/archiva.css @@ -48,4 +48,16 @@ .modified td{ border-top:2px solid #fbc7c6; border:2px solid #fbc7c6; +} + +.draggable-item { + cursor: move; +} + +.network-proxy-remote-item{ + margin-bottom: 12px; + min-height: 2px; + padding: 12px; + border: 2px dotted #ddd; + margin-left: 2em } \ No newline at end of file diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js index 92422f32f..e8c03f751 100644 --- a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js +++ b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js @@ -282,7 +282,7 @@ $(function() { return prx; } - updateModifiedProxyConnectors=function(){ + this.updateModifiedProxyConnectors=function(){ var modifiedProxyConnectors = getModifiedProxyConnectors(); openDialogConfirm(function(){ @@ -405,7 +405,8 @@ $(function() { var proxyConnectors=findProxyConnectorsWithSourceId(proxyConnector); $.log("displayOrderEdit:"+proxyConnector.sourceRepoId()+",number:"+proxyConnectors.length); - var proxyConnectorEditOrderViewModel=new ProxyConnectorEditOrderViewModel(proxyConnectors); + var managedRepository = getManagedRepository(proxyConnector.sourceRepoId()); + var proxyConnectorEditOrderViewModel=new ProxyConnectorEditOrderViewModel(proxyConnectors,self,managedRepository); ko.applyBindings(proxyConnectorEditOrderViewModel,$("#main-content #proxy-connector-edit-order").get(0)); activateProxyConnectorsEditOrderTab(); } @@ -442,17 +443,20 @@ $(function() { $("#proxy-connectors-view-tabs-a-network-proxies-grid").html($.i18n.prop("proxy-connectors.grid.tab.title")); mainContent.find("#proxy-connectors-view-tabs-li-edit a").html($.i18n.prop("add")); } + if ($(e.target).attr("href")=="#proxy-connectors-edit-order") { + activateProxyConnectorsEditOrderTab(); + } }); } } - ProxyConnectorEditOrderViewModel=function(proxyConnectors,proxyConnectorsViewModel){ + ProxyConnectorEditOrderViewModel=function(proxyConnectors,proxyConnectorsViewModel,managedRepository){ var self=this; this.proxyConnectors=ko.observableArray(proxyConnectors); this.proxyConnectorsViewModel=proxyConnectorsViewModel; - + this.managedRepository=managedRepository; proxyConnectorMoved=function(arg){ $.log("proxyConnectorMoved:"+arg.sourceIndex+" to " + arg.targetIndex); // if only 1 move just update two whereas update all with the new order @@ -466,6 +470,20 @@ $(function() { } } + this.findRemoteRepository=function(id){ + $.log("findRemoteRepository:"+id()); + for(i=0;i
-
-
    +
    +
    -
+
@@ -246,9 +247,34 @@ \ No newline at end of file +
+ {{var remoteRepository=$parent.findRemoteRepository(targetRepoId)}} +
+
+ +
+
+

${targetRepoId}

+

${remoteRepository.name()} (${remoteRepository.url()})

+ +
+
+
+ + + +