login.tmpl 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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>{{.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. {{if .DefaultLoginSource}}
  27. {{.DefaultLoginSource.Name}}
  28. {{else}}
  29. {{.i18n.Tr "auth.local"}}
  30. {{end}}
  31. </span>
  32. <i class="dropdown icon"></i>
  33. <div class="menu">
  34. <div class="item" data-value="0">{{.i18n.Tr "auth.local"}}</div>
  35. {{range .LoginSources}}
  36. <div class="item" data-value="{{.ID}}">{{.Name}}</div>
  37. {{end}}
  38. </div>
  39. </div>
  40. </div>
  41. {{end}}
  42. <div class="inline field">
  43. <label></label>
  44. <div class="ui checkbox">
  45. <label>{{.i18n.Tr "auth.remember_me"}}</label>
  46. <input name="remember" type="checkbox">
  47. </div>
  48. </div>
  49. <div class="inline field">
  50. <label></label>
  51. <button class="ui green button">{{.i18n.Tr "sign_in"}}</button>
  52. <a href="{{AppSubURL}}/user/forget_password">{{.i18n.Tr "auth.forget_password"}}</a>
  53. </div>
  54. {{if .ShowRegistrationButton}}
  55. <div class="inline field">
  56. <label></label>
  57. <a href="{{AppSubURL}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2HTML}}</a>
  58. </div>
  59. {{end}}
  60. </div>
  61. </form>
  62. </div>
  63. </div>
  64. </div>
  65. {{template "base/footer" .}}