<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title><{if $title}><{$title}><{/if}></title>
<link rel="stylesheet" href="<{$web_cfg.cdn}>/public/static/css/admin_style.css">
<script src="<{$web_cfg.cdn}>/kissy/1.4.0/seed.js?t=1408326831" data-config="{combine:false}" charset="utf-8"></script>
<script src="<{$web_cfg.cdn}>/cfg-min.js?t=1408326831" data-config="{combine:false}" charset="utf-8"></script>
<script src="<{$web_cfg.domain}>/kissy-versions.php" charset="utf-8"></script>
</head>
<style>
html {
    box-sizing: border-box;
    padding-top: 0;
}
body {
    background: none repeat scroll 0 0 #f1f1f1;
    color: #444;
    font-family: "Open Sans",sans-serif;
    font-size: 13px;
    line-height: 1.4em;
    min-width: 0;
	font-family: "Open Sans",sans-serif;
}
#login {
    margin: auto;
    padding: 8% 0 0;
    width: 320px;
}
.login h1 {
    color: #777;
    font-size: 30px;
    margin: 0;
    text-align: center;
	margin: 0 0 25px;
}
.login .message {
    background-color: #fff;
    border-left: 4px solid #2ea2cc;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
}
#login_error, .login .message {
    margin-left: 0;
    padding: 12px;
}
.login #login_error {
    background: none repeat scroll 0 0 #fff;
    border-left: 4px solid #dd3d36;
    box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
	display:none;
}
.login .form {
    background: none repeat scroll 0 0 #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.13);
    font-weight: 400;
    margin-left: 0;
    margin-top: 20px;
    overflow: hidden;
    padding: 26px 24px 46px;
}
#login .form p {
    margin-bottom: 0;
}
.login label {
    color: #777;
    font-size: 14px;
	font-weight: 300;
}
.login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
    background: none repeat scroll 0 0 #fbfbfb;
}
.login .form .input, .login input[type="text"] {
    font-size: 24px;
    margin: 2px 6px 16px 0;
    padding: 3px;
    width: 100%;
}
.login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
    background: none repeat scroll 0 0 #fbfbfb;
}
.login .form .input, .login .form input[type="checkbox"], .login input[type="text"] {
    background: none repeat scroll 0 0 #fbfbfb;
}
.login .form .input, .login input[type="text"] {
    font-size: 24px;
    margin: 2px 6px 16px 0;
    padding: 3px;
    width: 100%;
}
.login .form .input, .login input[type="text"] {
    font-size: 24px;
    margin: 2px 6px 16px 0;
    padding: 3px;
    width: 100%;
}
input[type="password"], input[type="text"] {
    background-color: #fff;
    border: 1px solid #ddd;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07) inset;
    color: #333;
    outline: 0 none;
    transition: border-color 0.05s ease-in-out 0s;
}
input[type="password"]:focus, input[type="text"]:focus {
	border-color: #5b9dd9;
	box-shadow: 0 0 2px rgba(30, 140, 190, 0.8);
}
.login .form .forgetmenot {
    float: left;
    font-weight: 400;
    margin-bottom: 0;
}
.login .form .forgetmenot label {
    font-size: 12px;
    line-height: 19px;
}
#login .form p.submit {
    margin: 0;
    padding: 0;
}
#loginform p.submit, .login-action-lostpassword p.submit {
    border: medium none;
    margin: -10px 0 20px;
}
p.submit {
    margin-top: 20px;
    max-width: 100%;
    padding-top: 10px;
    text-align: left;
}
.button.button-large {
    background: none repeat scroll 0 0 #2ea2cc;
    border: 1px solid;
    border-radius: 3px;
    box-shadow: 0 1px 0 rgba(120, 200, 230, 0.5) inset, 0 1px 0 rgba(0, 0, 0, 0.15);
    color: #fff;
    float: right;
    height: 30px;
    line-height: 28px;
    padding: 0 12px 2px;
    text-decoration: none;
    vertical-align: baseline;
}
.button-primary:focus, .button-primary:hover {
	background:#1e8cbe;
	border-color:#0074a2;
	-webkit-box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
	box-shadow:inset 0 1px 0 rgba(120,200,230,.6);
	color:#fff
}
</style>
<body class="login">

<div id="login">
	<h1>OnePage V1.0</h1>
	<div id="login_error"><strong>错误</strong>:键入的用户名或者密码不正确。<br></div>
	
	<div class="form" id="loginform" style="position: static; left: 0px;">
		<p>
			<label for="user_login">用户名<br>
			<input name="name" type="text" size="20" class="input" id="user_login"></label>
		</p>
		<p>
			<label for="user_pass">密码<br>
			<input name="pwd" type="password" size="20"  class="input" id="user_pass"></label>
		</p>
		<p class="forgetmenot">
			<label for="rememberme">
				<input type="checkbox" value="forever" id="rememberme" name="rememberme" checked> 记住我的登录信息
			</label>
		</p>
		<p class="submit submit_btn">
			<input type="submit" value="登录" class="button button-primary button-large" id="wp-submit" name="wp-submit">
		</p>
	</div>
</div>

<script>
KISSY.use('node, io', function (S, Node, IO) {
  var $ = S.all;
  
  $('input').on('keyup', function (ev) {
		var keyCode = ev.keyCode;
		if (keyCode == 13) {
			login();
		}
	});
  
  $('.submit_btn').on('click', function () {
	  login();
  });
  
  function login() {
	  var name = $("input[name=name]").val();
		var pwd = $("input[name=pwd]").val();
		new IO({
			type: "post"
			, url: '<{$web_cfg.domain}>/?c=Admin_BackUser&a=Login'
			, data: {'username':name,'password':pwd}
			, success: function (data) {
				if (data.ok) { //ok
					var url = data.msg;
					location.href = '<{$web_cfg.domain}>/?c=Admin_Index';
				} else {
					$(".welcome").hide();
					$("#login_error").show();
				}
				return false;
			}
			, error: function (NULL, textStatus) {
				alert("请求服务器失败,原因:"+textStatus);
			}
			, dataType: "json"
		});
  }
  
  function showError($msg) {
    $('.alert-danger').html($msg).show();
  }
});
</script>

</body>
</html>