wide/views/login.html

125 lines
6.7 KiB
HTML
Raw Normal View History

2014-10-24 07:41:23 +04:00
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
2014-12-11 06:40:30 +03:00
<title>{{.i18n.wide}} - {{.i18n.wide_title}}</title>
2015-03-21 13:10:53 +03:00
2014-12-25 12:08:58 +03:00
<meta name="keywords" content="Wide, Golang, IDE, Team, Cloud, B3log, Login"/>
<meta name="description" content="A Web-based IDE for Teams using Golang, do your development anytime, anywhere."/>
<meta name="author" content="B3log">
2015-03-21 13:10:53 +03:00
2014-10-24 07:41:23 +04:00
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/base.css?{{.conf.StaticResourceVersion}}">
2014-10-30 11:25:57 +03:00
<link rel="stylesheet" href="{{.conf.StaticServer}}/static/css/sign.css?{{.conf.StaticResourceVersion}}">
2014-10-24 07:41:23 +04:00
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
</head>
<body>
<div class="header">
<div class="wrapper fn-clear">
2014-12-25 12:08:58 +03:00
<a href="/login" rel="login">
<img title="Wide, a Web-based IDE for Teams using Golang." src="{{.conf.StaticServer}}/static/images/wide-logo.png"
2014-10-24 07:41:23 +04:00
class="logo"/></a>
<ul class="fn-right">
2015-02-26 12:01:39 +03:00
<li><a href="/playground" target="_blank" style="color: #cd504a">Play</a></li>
2014-12-25 12:08:58 +03:00
<li><a rel="bookmark" href="https://github.com/b3log/wide" target="_blank">GitHub</a></li>
2015-03-10 10:14:29 +03:00
<li><a href="http://pan.baidu.com/s/1dD3XwOT" target="_blank">{{.i18n.download}}</a></li>
2015-03-23 11:55:09 +03:00
<li><a rel="help" href="https://www.gitbook.com/book/88250/wide-user-guide" target="_blank">{{.i18n.help}}</a></li>
2015-02-21 07:27:04 +03:00
<li><a rel="bookmark" href="https://github.com/b3log/wide/issues/new" target="_blank">{{.i18n.issues}}</a></li>
2014-12-19 10:44:49 +03:00
<li><button class="btn btn-red" onclick="window.open('http://b3log.org/services')">{{.i18n.pricing}}</button></li>
2014-12-19 12:44:50 +03:00
<li><button class="btn" onclick="window.location.href = '/signup'">{{.i18n.sign_up}}</button></li>
2014-10-24 07:41:23 +04:00
</ul>
</div>
</div>
<div class="content">
<div class="wrapper fn-clear">
<div class="fn-left">
<h2>Hello, 世界</h2>
<h3>Coding with Go on the Wide way.</h3>
</div>
<div class="form fn-right">
<div id="msg" class="fn-none"></div>
2015-03-21 13:10:53 +03:00
<form id="loginForm">
<input id="username" name="username" placeholder="Username"/><br/>
<input id="password" name="password" type="password" placeholder="Password"/><br/>
<button id="loginBtn" type="submit" class="btn-white btn">{{.i18n.login}}</button>
</form>
2014-10-24 07:41:23 +04:00
</div>
</div>
</div>
<div class="footer">
2015-03-23 12:55:15 +03:00
<span class="wrapper">
2015-03-10 10:14:29 +03:00
Ver {{.ver}}, &copy; {{.year}} <a rel="copyright" href="http://b3log.org" target="_blank">B3LOG.ORG</a>, <a href="https://github.com/b3log/wide/blob/master/TERMS.md" target="_blank">{{.i18n.terms}}</a>
2015-03-23 12:55:15 +03:00
</span>
2015-03-23 16:15:21 +03:00
<div class="github-btns">
<iframe src="https://ghbtns.com/github-btn.html?user=b3log&repo=wide&type=star&count=true" frameborder="0" scrolling="0" width="100" height="20"></iframe>
</div>
2014-10-24 07:41:23 +04:00
</div>
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery-2.1.1.min.js"></script>
2015-03-21 13:10:53 +03:00
<script type="text/javascript" src="{{.conf.StaticServer}}/static/js/lib/jquery.form.js"></script>
2014-10-24 07:41:23 +04:00
<script type="text/javascript">
2015-03-21 13:10:53 +03:00
(function () {
var contentH = $(window).height() - $(".footer").height() - $(".header").height() - 18;
2015-09-26 12:33:55 +03:00
$(".content").outerHeight(contentH)
2015-03-21 13:10:53 +03:00
.css("padding-top", (contentH - $(".content .fn-left").height()) / 2 + "px");
2014-10-24 07:41:23 +04:00
2015-03-21 13:10:53 +03:00
$('#loginForm').submit(function () {
var options = {
url: '/login',
type: 'POST',
dataType: 'json',
beforeSubmit: function () {
var username = $.trim($("#username").val());
var password = $.trim($("#password").val());
2014-12-15 06:32:33 +03:00
2015-03-21 13:10:53 +03:00
if (username === "") {
$("#msg").text("{{.i18n.login_error}}").show();
$("#username").focus();
return false;
} else if (password === "") {
$("#msg").text("{{.i18n.login_error}}").show();
$("#password").focus();
return false;
}
},
success: function (data) {
if (!data.succ) {
$("#msg").text('{{.i18n.login_error}}').show();
return;
}
2014-10-24 07:41:23 +04:00
2015-03-21 13:10:53 +03:00
window.location.href = "/";
}
};
2014-10-24 07:41:23 +04:00
2015-03-21 13:10:53 +03:00
$('#loginForm').ajaxSubmit(options);
return false;
});
2014-10-24 07:41:23 +04:00
2015-03-21 13:10:53 +03:00
$("#username").keydown(function (event) {
if (event.which === 13) {
if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_error}}").show();
} else {
$("#password").focus();
return false;
}
} else {
$("#msg").hide();
}
}).focus();
2014-12-15 06:32:33 +03:00
2015-03-21 13:10:53 +03:00
$("#password").keydown(function (event) {
if (event.which === 13) {
if ($.trim($(this).val()) === "") {
$("#msg").text("{{.i18n.login_error}}").show();
}
} else {
$("#msg").hide();
}
});
})();
2014-10-24 07:41:23 +04:00
</script>
</body>
</html>