]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1577] rewrite legacy path admin page
authorOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:30:32 +0000 (18:30 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 6 Mar 2012 18:30:32 +0000 (18:30 +0000)
add js layout. use a generic naming for small admin screen.

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1297636 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/general-admin.js [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/search.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html [new file with mode: 0644]
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html

index 7079b3e53a9935accbe2cc6581582e430a897160..0cd557eabc0c7c8878514fc78c521800765613cb 100644 (file)
@@ -86,6 +86,7 @@ $.ajax(
            .script(buildLoadJsUrl("jquery.validate.js")).wait()
            .script("jquery.json-2.3.min.js").wait()
            .script(buildLoadJsUrl("archiva/main-tmpl.js")).wait()
+           .script(buildLoadJsUrl("archiva/general-admin.js"))
            .script(buildLoadJsUrl("archiva/repositories.js")).wait()
            .script(buildLoadJsUrl("archiva/network-proxies.js")).wait()
            .script(buildLoadJsUrl("archiva/proxy-connectors.js")).wait()
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/general-admin.js
new file mode 100644 (file)
index 0000000..9711235
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * 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() {
+
+  //-------------------------
+  // legacy path part
+  //-------------------------
+
+  LegacyPathViewModel=function(){
+
+  }
+
+  displayLegacySupport=function(){
+    clearUserMessages();
+    var mainContent=$("#main-content");
+
+    mainContent.html($("#legacy-path-main" ).html());
+
+    var legacyPathViewModel=new LegacyPathViewModel();
+
+    ko.applyBindings(legacyPathViewModel,mainContent.find("#legacy-path-screen" ).get(0))
+  }
+
+});
\ No newline at end of file
index 9f372f277f11585d0ae69101d988e317a7425e6a..21d31239c4730ce80a706a222fa01fd540324228 100644 (file)
@@ -851,7 +851,7 @@ $(function() {
           searchViewModel.observableRepoIds(repos);
           ko.applyBindings(searchViewModel,mainContent.find("#search-artifacts-div").get(0));
           mainContent.find("#search-basic-repostories-select" ).chosen();
-          if (successCallbackFn) successCallbackFn();
+          if (successCallbackFn!=null) successCallbackFn();
         }
     });
 
diff --git a/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html b/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/general-admin.html
new file mode 100644 (file)
index 0000000..d484b02
--- /dev/null
@@ -0,0 +1,25 @@
+<!--
+  ~ 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.
+-->
+<script id="legacy-path-main" type="text/html">
+ <div id="legacy-path-screen" data-bind='template:{name:"legacy-path-div"}'></div>
+</script>
+
+<script id="legacy-path-div" type="text/html">
+   foo
+</script>
\ No newline at end of file
index d82253abf36bf6f5cea0aa5eec79aae3ced1e594..1af0b573e15837ce39da76a741218e23f6ee90ec 100644 (file)
@@ -42,6 +42,9 @@
       <li style="display: none" redback-permissions="{permissions: ['archiva-manage-configuration']}">
         <a href="#" id="menu-network-proxies-list-a" onclick="displayNetworkProxies()">${$.i18n.prop('menu.network-proxies')}</a>
       </li>
+      <li style="display: none" redback-permissions="{permissions: ['archiva-manage-configuration']}">
+        <a href="#" id="menu-legacy-support-list-a" onclick="displayLegacySupport()">${$.i18n.prop('menu.legacy-support')}</a>
+      </li>
     </ul>
 
     <ul class="nav nav-list" redback-permissions="{permissions: ['archiva-manage-users']}">