gitea源码

signup_inner.tmpl 3.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <div class="ui container fluid{{if .LinkAccountMode}} icon{{end}}">
  2. <h4 class="ui top attached header center">
  3. {{if .LinkAccountMode}}
  4. {{ctx.Locale.Tr "auth.oauth_signup_title"}}
  5. {{else}}
  6. {{ctx.Locale.Tr "sign_up"}}
  7. {{end}}
  8. </h4>
  9. <div class="ui attached segment">
  10. {{if .IsFirstTimeRegistration}}
  11. <p>{{ctx.Locale.Tr "auth.sign_up_tip"}}</p>
  12. {{end}}
  13. <form class="ui form" action="{{.SignUpLink}}" method="post">
  14. {{.CsrfTokenHtml}}
  15. {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
  16. {{template "base/alert" .}}
  17. {{end}}
  18. {{if .DisableRegistration}}
  19. <p>{{ctx.Locale.Tr "auth.disable_register_prompt"}}</p>
  20. {{else}}
  21. <div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
  22. <label for="user_name">{{ctx.Locale.Tr "username"}}</label>
  23. <input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
  24. </div>
  25. <div class="required field {{if .Err_Email}}error{{end}}">
  26. <label for="email">{{ctx.Locale.Tr "email"}}</label>
  27. <input id="email" name="email" type="email" value="{{.email}}" required>
  28. </div>
  29. {{if not .DisablePassword}}
  30. <div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
  31. <label for="password">{{ctx.Locale.Tr "password"}}</label>
  32. <input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
  33. </div>
  34. <div class="required field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
  35. <label for="retype">{{ctx.Locale.Tr "re_type"}}</label>
  36. <input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
  37. </div>
  38. {{end}}
  39. {{template "user/auth/captcha" .}}
  40. <div class="inline field">
  41. <button class="ui primary button tw-w-full">
  42. {{if .LinkAccountMode}}
  43. {{ctx.Locale.Tr "auth.oauth_signup_submit"}}
  44. {{else}}
  45. {{ctx.Locale.Tr "auth.create_new_account"}}
  46. {{end}}
  47. </button>
  48. </div>
  49. {{end}}
  50. {{/* "oauth_container" contains not only "oauth2" methods, but also "OIDC" and "SSPI" methods */}}
  51. {{/* TODO: it seems that "EnableSSPI" is only set in "sign-in" handlers, but it should use the same logic to control its display */}}
  52. {{$showOAuth2Methods := or .OAuth2Providers .EnableOpenIDSignIn .EnableSSPI}}
  53. {{if $showOAuth2Methods}}
  54. <div class="divider divider-text">{{ctx.Locale.Tr "sign_in_or"}}</div>
  55. {{template "user/auth/oauth_container" .}}
  56. {{end}}
  57. </form>
  58. </div>
  59. </div>
  60. <div class="ui container fluid">
  61. {{if not .LinkAccountMode}}
  62. <div class="ui attached segment header top tw-flex tw-flex-col tw-items-center">
  63. <div class="field">
  64. <span>{{ctx.Locale.Tr "auth.already_have_account"}}</span>
  65. <a href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "auth.sign_in_now"}}</a>
  66. </div>
  67. </div>
  68. {{end}}
  69. </div>