]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1578] add layout
authorOlivier Lamy <olamy@apache.org>
Thu, 26 Jan 2012 22:57:15 +0000 (22:57 +0000)
committerOlivier Lamy <olamy@apache.org>
Thu, 26 Jan 2012 22:57:15 +0000 (22:57 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1236434 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/main-tmpl.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html [new file with mode: 0644]

index d0168dfeac9a39ba4ab5c3b552e5a73dc73efe08..bbe95deca12e0c8285fe4fc921adcd14f13387db 100644 (file)
@@ -70,6 +70,7 @@ $.ajax(
            .script("jquery.json-2.3.min.js").wait()
            .script("archiva/main-tmpl.js").wait()
            .script("archiva/repositories.js").wait()
+           .script("archiva/network-proxies.js").wait()
            .script("redback/operation.js").wait()
            .script("redback/redback-tmpl.js").wait()
            .script("bootstrap-tabs.js")
index 8acd644a6a2a4b56308e29ee5c021be0d8cdde30..a49d1d35d559eb67786d923b48c625b1a253d2d7 100644 (file)
@@ -19,8 +19,9 @@
 require(["text!archiva/templates/menu.html?"+timestampNoCache(),"text!archiva/templates/topbar.html?"+timestampNoCache(),
           "text!archiva/templates/message.html?"+timestampNoCache(),"text!archiva/templates/modal.html?"+timestampNoCache(),
           "text!archiva/templates/grids-generics.html?"+timestampNoCache(),
-          "text!archiva/templates/repositories.html?"+timestampNoCache()],
-  function(menu,topbar,message,modal,grids_generics,repositories) {
+          "text!archiva/templates/repositories.html?"+timestampNoCache(),
+          "text!archiva/templates/network-proxies.html?"+timestampNoCache()],
+  function(menu,topbar,message,modal,grids_generics,repositories,network_proxies) {
 
     // template loading
     $.tmpl( menu ).appendTo("#html-fragments");
@@ -29,6 +30,7 @@ require(["text!archiva/templates/menu.html?"+timestampNoCache(),"text!archiva/te
     $.tmpl( modal ).appendTo("#html-fragments");
     $("#html-fragments").append(grids_generics);
     $("#html-fragments").append(repositories);
+    $("#html-fragments").append(network_proxies);
     $.log("main-tmpl.js menu loaded");
   }
 );
\ No newline at end of file
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/network-proxies.js
new file mode 100644 (file)
index 0000000..e3dc7b6
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+$(function() {
+
+
+  displayNetworkProxies=function(){
+
+  }
+
+  NetworkProxy=function(id,protocol,host,port,username,password){
+    //private String id;
+    this.id = ko.observable(id);
+
+    //private String protocol = "http";
+    this.protocol=ko.observable(protocol);
+
+    //private String host;
+    this.host=ko.observable(host);
+
+    //private int port = 8080;
+    this.port=ko.observable(port);
+
+    //private String username;
+    this.username=ko.observable(username);
+
+    //private String password;
+    this.password=ko.observable(password);
+  }
+
+  NetworkProxyViewModel=function(networkProxy, update, networkProxiesViewModel){
+    this.update=update;
+    this.networkProxy=networkProxy;
+    this.networkProxiesViewModel=networkProxiesViewModel;
+    var self=this;
+
+    save=function(){
+
+    }
+
+    displayGrid=function(){
+
+    }
+  }
+
+  NetworkProxiesViewModel=function(){
+    this.networkProxies=ko.observableArray([]);
+
+    var self=this;
+
+    editNetworkProxy=function(networkProxy){
+
+    }
+
+    removeNetworkProxy=function(networkProxy){
+
+    }
+  }
+
+
+  displayNetworkProxies=function(){
+    var networkProxiesViewModel = new NetworkProxiesViewModel();
+  }
+
+  mapNetworkProxy=function(data){
+    if (data==null){
+      return null;
+    }
+    return new NetworkProxy(data.id,data.protocol,data.host,data.port,data.username,data.password);
+  }
+
+  mapNetworkProxies=function(data){
+    var mappedNetworkProxies = $.map(data.networkProxy, function(item) {
+      return mapNetworkProxy(item);
+    });
+    return mappedNetworkProxies;
+  }
+
+});
\ No newline at end of file
index 50d1750b0ccceed8d34c035ea91702be65d0914c..9972c79511abd9a35462cf50eb530e0bd669dc01 100644 (file)
@@ -27,5 +27,8 @@
       <li style="display: none" redback-permissions="{permissions: ['archiva-manage-configuration']}">
         <a href="#" id="menu-repositories-list-a" onclick="displayRepositoriesGrid()">${$.i18n.prop('repositories.list')}</a>
       </li>
+      <li style="display: none" redback-permissions="{permissions: ['archiva-manage-configuration']}">
+        <a href="#" id="menu-network-proxies-list-a" onclick="displayNetworkProxies()">${$.i18n.prop('repositories.list')}</a>
+      </li>
     </ul>
   </div>
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
new file mode 100644 (file)
index 0000000..e69de29