login.tmpl 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. {{template "base/head" .}}
  2. <div class="user signin">
  3. <div class="ui middle very relaxed page grid">
  4. <div class="column">
  5. <form class="ui form" action="{{.Link}}" method="post">
  6. {{.CSRFTokenHTML}}
  7. <h3 class="ui top attached header">
  8. {{.i18n.Tr "sign_in"}}
  9. </h3>
  10. <div class="ui attached segment">
  11. {{template "base/alert" .}}
  12. <div class="required inline field {{if .Err_UserName}}error{{end}}">
  13. <label for="user_name">{{.i18n.Tr "home.uname_holder"}}</label>
  14. <input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
  15. </div>
  16. <div class="required inline field {{if .Err_Password}}error{{end}}">
  17. <label for="password">{{.i18n.Tr "password"}}</label>
  18. <input id="password" name="password" type="password" autocomplete="off" value="{{.password}}" required>
  19. </div>
  20. {{if .LoginSources}}
  21. <div class="required inline field {{if .Err_LoginSource}}error{{end}}">
  22. <label for="password">{{.i18n.Tr "auth.auth_source"}}</label>
  23. <div class="ui selection dropdown">
  24. <input type="hidden" id="login_source" name="login_source" value="{{.login_source}}" required>
  25. <span class="text">
  26. {{.i18n.Tr "auth.local"}}
  27. </span>
  28. <i class="dropdown icon"></i>
  29. <div class="menu">
  30. <div class="item" data-value="0">{{.i18n.Tr "auth.local"}}</div>
  31. {{range .LoginSources}}
  32. <div class="item" data-value="{{.ID}}">{{.Name}}</div>
  33. {{end}}
  34. </div>
  35. </div>
  36. </div>
  37. {{end}}
  38. <div class="inline field">
  39. <label></label>
  40. <div class="ui checkbox">
  41. <label>{{.i18n.Tr "auth.remember_me"}}</label>
  42. <input name="remember" type="checkbox">
  43. </div>
  44. </div>
  45. <div class="inline field">
  46. <label></label>
  47. <button class="ui green button">{{.i18n.Tr "sign_in"}}</button>
  48. <a href="{{AppSubURL}}/user/forget_password">{{.i18n.Tr "auth.forget_password"}}</a>
  49. </div>
  50. {{if .ShowRegistrationButton}}
  51. <div class="inline field">
  52. <label></label>
  53. <a href="{{AppSubURL}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
  54. </div>
  55. {{end}}
  56. </div>
  57. </form>
  58. </div>
  59. </div>
  60. </div>
  61. {{template "base/footer" .}}