* Added new dep: gorilla/csrf * CSRF field in forms * CSRF variable in commontemplatevariables * New key for messages and user context Please change EnableSecureCSRF to false when testing locally and don't merge config/env.go with the changes
34 lignes
1,6 Kio
HTML
34 lignes
1,6 Kio
HTML
{{define "title"}}{{ call $.T "sign_in_title" }}{{end}}
|
|
{{define "contclass"}}cont-view{{end}}
|
|
{{define "content"}}
|
|
{{ with .Form }}
|
|
<div class="box">
|
|
<div class="user-form">
|
|
<form role="form" method="POST">
|
|
{{ block "csrf_field" $ }}{{end}}
|
|
<h2>{{call $.T "sign_in_box_title"}}</h2>
|
|
{{ range (index $.FormErrors "errors")}}
|
|
<div class="alert alert-danger">{{ . }}</div>
|
|
{{end}}
|
|
<input type="text" name="username" id="username" class="form-input up-input" autofocus placeholder="{{ call $.T "email_address_or_username"}}"><br>
|
|
{{ range (index $.FormErrors "username")}}
|
|
<p class="text-error">{{ . }}</p>
|
|
{{end}}
|
|
<input type="password" name="password" id="password" class="form-input up-input" placeholder="{{ call $.T "password"}}"><br>
|
|
{{ range (index $.FormErrors "password")}}
|
|
<p class="text-error">{{ . }}</p>
|
|
{{end}}
|
|
<!-- <span class="button-checkbox">
|
|
<button type="button" class="btn hidden" data-color="info">{{ call $.T "remember_me"}}</button>
|
|
<input type="checkbox" name="remember_me" id="remember_me" checked="checked">
|
|
<a href="" class="btn btn-link pull-right">{{ call $.T "forgot_password"}}</a>
|
|
</span> -->
|
|
<input type="submit" class="form-input" value="{{ call $.T "signin"}}">
|
|
<a href="{{ genRoute "user_register" }}" class="btn btn-lg btn-primary btn-block">{{ call $.T "register"}}</a>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
{{end}}
|
|
<br />
|
|
<br />
|
|
{{end}}
|