Skip to content

Commit

Permalink
add Shortcut Keys in signup and signin page
Browse files Browse the repository at this point in the history
  • Loading branch information
jayden committed Jul 24, 2017
1 parent 1251f35 commit 2644687
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 47 deletions.
53 changes: 9 additions & 44 deletions template/auth/signin.html
Original file line number Diff line number Diff line change
@@ -1,46 +1,3 @@
<!-- <div class="user signin">
<div class="ui middle very relaxed page grid">
<div class="column">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
登陆
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
<label for="user_name">用户名或邮箱</label>
<input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
<label for="password">密码</label>
<input id="password" name="password" type="password" value="{{.password}}" required>
</div>
<div class="inline field">
<label></label>
<div class="ui checkbox">
<label>记住登录</label>
<input name="remember" type="checkbox">
</div>
</div>
<div class="inline field">
<label></label>
<button class="ui green button">登陆</button>
<a href="{{AppSubURL}}/web/auth/forget_password">忘记密码?</a>
</div>
{{if .ShowRegistrationButton}}
<div class="inline field">
<label></label>
<a href="{{AppSubURL}}/web/auth/signup">还没帐户?马上注册。</a>
</div>
{{end}}
</div>
</form>
</div>
</div>
</div> -->

{{template "base/header_2" .}}
<div class="ui grid center aligned">
<div class="row">
Expand Down Expand Up @@ -104,4 +61,12 @@ <h1 class="ui header center aligned">
</div>
</div>
</div>
{{template "base/footer_2" .}} {{template "base/background" .}}
{{template "base/footer_2" .}}
{{template "base/background" .}}
<script>
document.onkeydown = function keyListener(e) {
if (e.keyCode == 13) {
$('#form_login').submit();
}
}
</script>
14 changes: 11 additions & 3 deletions template/auth/signup.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,15 @@ <h1 class="ui header center aligned">
<i class="icon key"></i>
</div>
</div>
{{if .EnableCaptcha}}
<div class="inline field {{if .Err_Captcha}}error{{end}}">
<label for="captcha">CAPTCHA:</label> {{.Captcha.CreateHtml}}
<div class="required ui fluid icon input ">
<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
<i class="icon code"></i>
</div>

</div>
{{end}}

<div class="field">

Expand All @@ -84,5 +85,12 @@ <h1 class="ui header center aligned">
</div>
</div>
</div>
{{template "base/footer_2" .}}
{{template "base/background" .}}
{{template "base/footer_2" .}} {{template "base/background" .}}
<script>
document.onkeydown = function keyListener(e) {
if (e.keyCode == 13) {
$('#form_signup').submit();
}
}

</script>

0 comments on commit 2644687

Please sign in to comment.