You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

67 lines
2.6 KiB

  1. {{template "base/head" .}}
  2. <div class="user reset password">
  3. <div class="ui middle very relaxed page grid">
  4. <div class="column">
  5. <form class="ui form ignore-dirty" action="{{.Link}}" method="post">
  6. {{.CsrfTokenHtml}}
  7. <input name="code" type="hidden" value="{{.Code}}">
  8. <h2 class="ui top attached header">
  9. {{.i18n.Tr "auth.reset_password"}}
  10. </h2>
  11. <div class="ui attached segment">
  12. {{template "base/alert" .}}
  13. {{if .user_email }}
  14. <div class="inline field">
  15. <label for="user_name">{{.i18n.Tr "email"}}</label>
  16. <input id="user_name" type="text" value="{{ .user_email }}" disabled>
  17. </div>
  18. {{end}}
  19. {{if .IsResetForm}}
  20. <div class="required inline field {{if .Err_Password}}error{{end}}">
  21. <label for="password">{{.i18n.Tr "settings.new_password"}}</label>
  22. <input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" autofocus required>
  23. </div>
  24. {{if not .user_signed_in}}
  25. <div class="inline field">
  26. <label></label>
  27. <div class="ui checkbox">
  28. <label>{{.i18n.Tr "auth.remember_me"}}</label>
  29. <input name="remember" type="checkbox">
  30. </div>
  31. </div>
  32. {{end}}
  33. {{if .has_two_factor}}
  34. <h4 class="ui dividing header">
  35. {{.i18n.Tr "twofa"}}
  36. </h4>
  37. <div class="ui warning visible message">{{.i18n.Tr "settings.twofa_is_enrolled" | Str2html }}</div>
  38. {{if .scratch_code}}
  39. <div class="required inline field {{if .Err_Token}}error{{end}}">
  40. <label for="token">{{.i18n.Tr "auth.scratch_code"}}</label>
  41. <input id="token" name="token" type="text" autocomplete="off" autofocus required>
  42. </div>
  43. <input type="hidden" name="scratch_code" value="true">
  44. {{else}}
  45. <div class="required inline field {{if .Err_Passcode}}error{{end}}">
  46. <label for="passcode">{{.i18n.Tr "passcode"}}</label>
  47. <input id="passcode" name="passcode" type="number" autocomplete="off" autofocus required>
  48. </div>
  49. {{end}}
  50. {{end}}
  51. <div class="ui divider"></div>
  52. <div class="inline field">
  53. <label></label>
  54. <button class="ui blue button">{{.i18n.Tr "auth.reset_password_helper"}}</button>
  55. {{if and .has_two_factor (not .scratch_code)}}
  56. <a href="{{.Link}}?code={{.Code}}&amp;scratch_code=true">{{.i18n.Tr "auth.use_scratch_code" | Str2html}}</a>
  57. {{end}}
  58. </div>
  59. {{else}}
  60. <p class="center">{{.i18n.Tr "auth.invalid_code"}}</p>
  61. {{end}}
  62. </div>
  63. </form>
  64. </div>
  65. </div>
  66. </div>
  67. {{template "base/footer" .}}