my-gitea-templates/templates/user/auth/ signin_inner.tmpl
68 lines
2.9 KiB

  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. {{.i18n.Tr "auth.oauth_signin_title"}}
  7. {{else}}
  8. {{.i18n.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. {{if and .OrderedOAuth2Names .OAuth2Providers}}
  15. <div class="oauth center">
  16. <div>
  17. {{range $key := .OrderedOAuth2Names}}
  18. {{$provider := index $.OAuth2Providers $key}}
  19. <a href="{{AppSubUrl}}/user/oauth2/{{$key}}"><img style="width: 80px; height: auto; margin: 20px;" alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}" title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}" class="{{$provider.Name}}" src="{{AppSubUrl}}{{$provider.Image}}"></a>
  20. {{end}}
  21. </div>
  22. <p>Please log in with one of these identity providers.</p>
  23. <p style="font-style: italic;">(apologies for limiting your choice of identity provider; it's a compromise for the time being. When will <a href="https://openid.net/">OpenID</a>, <a href="https://webid.info/">WebID</a>, <a href="https://en.wikipedia.org/wiki/BrowserID">BrowserID</a> or whatever vendor-neutral solution finally be adopted widely?)</p>
  24. </div>
  25. {{end}}
  26. <details style="margin-top: 2em;"><summary style="color: lightgrey;">Staff entrance</summary>
  27. <div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
  28. <label for="user_name">{{.i18n.Tr "home.uname_holder"}}</label>
  29. <input id="user_name" name="user_name" value="{{.user_name}}" autofocus required>
  30. </div>
  31. <div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
  32. <label for="password">{{.i18n.Tr "password"}}</label>
  33. <input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
  34. </div>
  35. {{if not .LinkAccountMode}}
  36. <div class="inline field">
  37. <label></label>
  38. <div class="ui checkbox">
  39. <label>{{.i18n.Tr "auth.remember_me"}}</label>
  40. <input name="remember" type="checkbox">
  41. </div>
  42. </div>
  43. {{end}}
  44. <div class="inline field">
  45. <label></label>
  46. <button class="ui green button">
  47. {{if .LinkAccountMode}}
  48. {{.i18n.Tr "auth.oauth_signin_submit"}}
  49. {{else}}
  50. {{.i18n.Tr "sign_in"}}
  51. {{end}}
  52. </button>
  53. <a href="{{AppSubUrl}}/user/forgot_password">{{.i18n.Tr "auth.forgot_password"}}</a>
  54. </div>
  55. {{if .ShowRegistrationButton}}
  56. <div class="inline field">
  57. <label></label>
  58. <a href="{{AppSubUrl}}/user/sign_up">{{.i18n.Tr "auth.sign_up_now" | Str2html}}</a>
  59. </div>
  60. {{end}}
  61. </details>
  62. </form>
  63. </div>