]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1576] rewrite proxies connector page
authorOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 17:24:24 +0000 (17:24 +0000)
committerOlivier Lamy <olamy@apache.org>
Fri, 10 Feb 2012 17:24:24 +0000 (17:24 +0000)
sourceRepoId and targetRepoId not editable on proxyConnector edition.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1242864 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

index ae0c71d3c13549225bef1cf6c2ee4a70359bb6fb..e1aa9fd3d6a7efc8ede576e8b1d8932d7c7cfa7d 100644 (file)
@@ -127,6 +127,10 @@ $(function() {
     this.update=update;
     this.modified=ko.observable(false);
 
+    isUpdate=function(){
+      return self.update;
+    }
+
     getSelectedPolicyOption=function(id){
       $.log("getSelectedPolicyOption:"+id);
 
@@ -270,6 +274,7 @@ $(function() {
       mainContent.find("#proxy-connectors-edit").html($("#proxy-connector-edit-form-tmpl").tmpl());
       ko.applyBindings(proxyConnectorViewModel,mainContent.find("#proxy-connectors-edit").get(0));
       activateProxyConnectorsEditTab();
+      mainContent.find("#proxy-connectors-view-tabs-li-edit a").html($.i18n.prop("edit"));
     }
     deleteProxyConnector=function(proxyConnector){
       clearUserMessages();
@@ -364,7 +369,7 @@ $(function() {
         }
         if ($(e.target).attr("href")=="#proxy-connectors-view") {
           $("#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"));
         }
 
       });
index b278748d22788c0976b060a3b6875e0f577e44b8..2885b7582312451692630dd6df485b929c471e8b 100644 (file)
@@ -63,7 +63,7 @@
     </thead>
     <tbody>
     {{each(i, row) itemsOnCurrentPage()}}
-    <tr>
+    <tr data-bind="css:{ 'modified': row.modified()}">
       <td>${row.sourceRepoId()}</td>
       <td>${row.targetRepoId()}-${row.order()}</td>
       <td><img src="images/utilities-system-monitor.png" id="proxy-connectors-grid-remoterepo-settings-edit-${row.sourceRepoId()}-${row.targetRepoId()}"
         <div class="control-group">
           <label class="control-label" for="proxyId">${$.i18n.prop('proxy-connector.managed.repository.id')}</label>
           <div class="controls">
-            <select id="sourceRepoId"
-                    data-bind="options: proxyConnectorsViewModel.managedRepositories, optionsText: 'id',optionsValue:'id',
-                     value: proxyConnector.sourceRepoId"></select>
+              <select id="sourceRepoId"
+                      data-bind="options: proxyConnectorsViewModel.managedRepositories, optionsText: 'id',optionsValue:'id',
+                      value: proxyConnector.sourceRepoId,attr: {disabled: isUpdate() }"></select>
           </div>
         </div>
         <div class="control-group">
           <div class="controls">
             <select id="targetRepoId"
                     data-bind="options: proxyConnectorsViewModel.remoteRepositories, optionsText: 'id',optionsValue:'id',
-                     value: proxyConnector.targetRepoId"></select>
+                     value: proxyConnector.targetRepoId,attr: {disabled: isUpdate() }"></select>
           </div>
         </div>
         <div class="control-group span6">