[Kimchi-devel] [PATCH V4 1/5] create a new login page

shaohef at linux.vnet.ibm.com shaohef at linux.vnet.ibm.com
Wed Jun 11 16:24:33 UTC 2014


From: ShaoHe Feng <shaohef at linux.vnet.ibm.com>

this page is used for the session timeout or first login.

Signed-off-by: ShaoHe Feng <shaohef at linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
---
 ui/images/progressing.gif | Bin 0 -> 1152 bytes
 ui/pages/login.html.tmpl  | 110 ++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 110 insertions(+)
 create mode 100644 ui/images/progressing.gif
 create mode 100644 ui/pages/login.html.tmpl

diff --git a/ui/images/progressing.gif b/ui/images/progressing.gif
new file mode 100644
index 0000000000000000000000000000000000000000..6552d41d9d4c874091bb51931c6adf64a95e8bd0
GIT binary patch
literal 1152
zcmZ?wbhEHb6k!ly*v!E2|NsBHckiA#b7s?~O&uK_IXO9 at p`oUxrgCy}4A_9;e{Mh5
zkYH!W09PYD17=2`8pWS1oFWVy3_2k7AY&O=+5}E^`WY^hIhD at I;2`qkhUamCHs#2?
zD{Sl5ddqAu;o;E8n07H&VTOd$9w+z3Od8dz)1OOlg at hfQ?6P6gg)Nhut~h8s_iHy|
zTx?f<DfNuF4qs+in1T70o7P)P87f1<g5(0~t-`bz%`;<c7;R*Hby&0+Cd*D$nyx)7
zxH>hoEs9-2GEYbl<TO?^r*$AZO&~F#<dR{_!xK!0-EtLPZ*p|yWoF`%>SmZA?aQ<9
zUT3kA$h=8X2{%vLaEeZ2FfFvxHCy+@)2xTXXx&nW19L8~I4mhFCLSR*N5YUN_g8RC
zxvG$d3rC2Yoni>Hr8Z+mk+UtMt&Fyriq3S|nYyz*lh|s_)v7fmBnyPWjzbSOeSwpn
ztM^*GK3gr at WX{W=;H4 at s$Eix`o#&Z+UC|vq;?Mm$*qz>q{MpOLKD$V>lW^GM at gRp<
zTfqAxmTMW#NQtz1Ow(GUENaLTnG@~OSSl%)a-~@^*=_L^Wu6LazRZG$dI^iu%U-z%
zg<00g*_8=1ySk){v9Pk(*~<9qvQD2qQDdsojG1{NY_a__TQemj7eK-u-Fqm>f>utm
zWMS=L&jJU059 at Suul#8<RCK0juuU^pO9X~|9`=wYHdzoCYCehQmh?GGSt;IO&EY61
z^|cU^WKC}pQa3GC)^bS)J5HFrADAqr$@=Tg_KIeUMR6Q at nr+9QW_y9zNsLj!T)@YO
zmFW>EN`0IXPrZ>S5M3ptD%hrTMQhc8T>+_g4tF#}E)IMpc<k8J3C>bEce!tTI4V-^
zEEL|{;B8wW%<SUK!k*>CY&#hksVX{CWv466RGb|aXRcN%49rjY*aHrnWY;d4a(eT<
sn9_<U58lHODbH9KGQC;#6 at s@G?AG7t-SQycLr1Fr#FC=U9tH+$0KoWQ9smFU

literal 0
HcmV?d00001

diff --git a/ui/pages/login.html.tmpl b/ui/pages/login.html.tmpl
new file mode 100644
index 0000000..bf93732
--- /dev/null
+++ b/ui/pages/login.html.tmpl
@@ -0,0 +1,110 @@
+#*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2014
+ *
+ * Licensed 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.
+ *#
+#unicode UTF-8
+#import gettext
+#from kimchi.cachebust import href
+#silent t = gettext.translation($lang.domain, $lang.localedir, languages=$lang.lang)
+#silent _ = t.gettext
+#silent _t = t.gettext
+#from kimchi.config import get_version
+<!DOCTYPE html>
+<html lang="$lang.lang[0]">
+<head>
+<meta charset="UTF-8">
+<title>Kimchi</title>
+<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
+<link rel="shortcut icon" href="images/logo.ico">
+<link rel="stylesheet" href="$href('css/theme-default.min.css')">
+<script src="$href('libs/jquery-1.10.0.min.js')"></script>
+<script src="$href('libs/jquery-ui.min.js')"></script>
+<script src="$href('libs/jquery-ui-i18n.min.js')"></script>
+<script src="$href('js/kimchi.min.js')"></script>
+<style type="text/css">
+.topbar select {
+    float: right;
+    margin-top: 12px;
+    margin-right: 10px;
+}
+.login-area {
+    margin: 120px auto 0;
+}
+.login-panel {
+    width: 315px;
+}
+.err-area {
+    height: 80px;
+}
+.err-mess {
+    color: #C85305;
+}
+</style>
+<script>
+function changeLang() {
+    var lang = document.getElementById('userLang').value;
+    kimchi.cookie.set('kimchiLang', lang, 365);
+    window.location.reload();
+}
+function setLang() {
+    var defaultLang = 'en_US';
+    var clientLang = document.getElementsByTagName("html")[0].getAttribute("lang");
+    var persistLang = kimchi.cookie.get('kimchiLang');
+    document.getElementById("userLang").value = persistLang || clientLang || defaultLang;
+}
+function updateBtnLabel() {
+    document.getElementById("login").style.display = "none";
+    document.getElementById("logging").style.display = "";
+}
+function init() {
+    setLang();
+}
+</script>
+</head>
+<body onload="init()">
+<div class="container topbar">
+    <span id="logo"><img alt="Project Kimchi" src="images/theme-default/logo-white.png"></span>
+    <select id="userLang" onchange="changeLang()">
+        <option value="en_US">English (US)</option>
+        <option value="zh_CN">中文(简体)</option>
+        <option value="pt_BR">Português (Brasil)</option>
+    </select>
+</div>
+<div id="login-window" class="login-area">
+    <div class="err-area">
+        <div id="messUserPass" class="err-mess" style="display: none;">$_("The username or password you entered is incorrect. Please try again.")</div>
+        <div id="messSession" class="err-mess" style="display: none;">$_("Session timeout, please re-login.")</div>
+    </div>
+    <form id="form-login" action="/login" method="POST" class="login-panel" onsubmit="updateBtnLabel();">
+        <div class="row">
+            <input type="text" id="username" name="username" required="required" placeholder="$_("User Name")" autofocus/>
+            <div id="username-msg" class="msg-required"></div>
+        </div>
+        <div class="row">
+            <input type="password" id="password" name="password" required="required" placeholder="$_("Password")" />
+            <div id="password-msg" class="msg-required"></div>
+        </div>
+        <div class="row">
+        <button id="btn-login" class="btn-normal">
+            <label id="login">$_("Log in")</label>
+            <label id="logging" style="display: none;">$_("Logging in...")</label>
+        </button>
+        </div>
+    </form>
+</div>
+</body>
+</html>
-- 
1.9.3




More information about the Kimchi-devel mailing list