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.

signin_inner.tmpl 2.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn)}}
  2. {{template "base/alert" .}}
  3. {{end}}
  4. <h4 class="ui top attached header center">
  5. {{if .LinkAccountMode}}
  6. {{ctx.Locale.Tr "auth.oauth_signin_title"}}
  7. {{else}}
  8. {{ctx.Locale.Tr "auth.login_userpass"}}
  9. {{end}}
  10. </h4>
  11. <div class="ui attached segment">
  12. <form class="ui form" action="{{.SignInLink}}" method="post">
  13. {{.CsrfTokenHtml}}
  14. <div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
  15. <label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
  16. <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
  17. </div>
  18. {{if or (not .DisablePassword) .LinkAccountMode}}
  19. <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
  20. <label for="password">{{ctx.Locale.Tr "password"}}</label>
  21. <input id="password" name="password" type="password" value="{{.password}}" autocomplete="current-password" required>
  22. </div>
  23. {{end}}
  24. {{if not .LinkAccountMode}}
  25. <div class="inline field">
  26. <label></label>
  27. <div class="ui checkbox">
  28. <label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
  29. <input name="remember" type="checkbox">
  30. </div>
  31. </div>
  32. {{end}}
  33. {{template "user/auth/captcha" .}}
  34. <div class="inline field">
  35. <label></label>
  36. <button class="ui primary button">
  37. {{if .LinkAccountMode}}
  38. {{ctx.Locale.Tr "auth.oauth_signin_submit"}}
  39. {{else}}
  40. {{ctx.Locale.Tr "sign_in"}}
  41. {{end}}
  42. </button>
  43. <a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
  44. </div>
  45. {{if .ShowRegistrationButton}}
  46. <div class="inline field">
  47. <label></label>
  48. <a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now"}}</a>
  49. </div>
  50. {{end}}
  51. {{if .OAuth2Providers}}
  52. <div class="divider divider-text">
  53. {{ctx.Locale.Tr "sign_in_or"}}
  54. </div>
  55. <div id="oauth2-login-navigator" class="gt-py-2">
  56. <div class="gt-df gt-fc gt-jc">
  57. <div id="oauth2-login-navigator-inner" class="gt-df gt-fc gt-fw gt-ac gt-gap-3">
  58. {{range $provider := .OAuth2Providers}}
  59. <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$provider.DisplayName}}">
  60. {{$provider.IconHTML 28}}
  61. {{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
  62. </a>
  63. {{end}}
  64. </div>
  65. </div>
  66. </div>
  67. {{end}}
  68. </form>
  69. </div>