|
1 |
| - {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn)}} |
2 |
| - {{template "base/alert" .}} |
3 |
| - {{end}} |
4 |
| - <h4 class="ui top attached header center"> |
| 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 | + {{.locale.Tr "auth.oauth_signin_title"}} |
| 7 | + {{else}} |
| 8 | + {{.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">{{.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">{{.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>{{.locale.Tr "auth.remember_me"}}</label> |
| 29 | + <input name="remember" type="checkbox"> |
| 30 | + </div> |
| 31 | + </div> |
| 32 | + {{end}} |
| 33 | + |
| 34 | + {{template "user/auth/captcha" .}} |
| 35 | + |
| 36 | + <div class="inline field"> |
| 37 | + <label></label> |
| 38 | + <button class="ui green button"> |
5 | 39 | {{if .LinkAccountMode}}
|
6 |
| - {{.locale.Tr "auth.oauth_signin_title"}} |
| 40 | + {{.locale.Tr "auth.oauth_signin_submit"}} |
7 | 41 | {{else}}
|
8 |
| - {{.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">{{.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">{{.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>{{.locale.Tr "auth.remember_me"}}</label> |
29 |
| - <input name="remember" type="checkbox"> |
30 |
| - </div> |
31 |
| - </div> |
| 42 | + {{.locale.Tr "sign_in"}} |
32 | 43 | {{end}}
|
| 44 | + </button> |
| 45 | + <a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a> |
| 46 | + </div> |
33 | 47 |
|
34 |
| - {{template "user/auth/captcha" .}} |
35 |
| - |
36 |
| - <div class="inline field"> |
37 |
| - <label></label> |
38 |
| - <button class="ui green button"> |
39 |
| - {{if .LinkAccountMode}} |
40 |
| - {{.locale.Tr "auth.oauth_signin_submit"}} |
41 |
| - {{else}} |
42 |
| - {{.locale.Tr "sign_in"}} |
43 |
| - {{end}} |
44 |
| - </button> |
45 |
| - <a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a> |
46 |
| - </div> |
47 |
| - |
48 |
| - {{if .ShowRegistrationButton}} |
49 |
| - <div class="inline field"> |
50 |
| - <label></label> |
51 |
| - <a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a> |
52 |
| - </div> |
53 |
| - {{end}} |
| 48 | + {{if .ShowRegistrationButton}} |
| 49 | + <div class="inline field"> |
| 50 | + <label></label> |
| 51 | + <a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a> |
| 52 | + </div> |
| 53 | + {{end}} |
54 | 54 |
|
55 |
| - {{if and .OrderedOAuth2Names .OAuth2Providers}} |
56 |
| - <div class="ui attached segment"> |
57 |
| - <div class="oauth2 center"> |
58 |
| - <div id="oauth2-login-loader" class="ui disabled centered loader"></div> |
59 |
| - <div> |
60 |
| - <div id="oauth2-login-navigator"> |
61 |
| - <p>{{.locale.Tr "sign_in_with"}}</p> |
62 |
| - {{range $key := .OrderedOAuth2Names}} |
63 |
| - {{$provider := index $.OAuth2Providers $key}} |
64 |
| - <a href="{{AppSubUrl}}/user/oauth2/{{$key}}"> |
65 |
| - <img |
66 |
| - alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}" |
67 |
| - title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}" |
68 |
| - class="{{$provider.Name}} oauth-login-image" |
69 |
| - src="{{AppSubUrl}}{{$provider.Image}}" |
70 |
| - ></a> |
| 55 | + {{if and .OrderedOAuth2Names .OAuth2Providers}} |
| 56 | + <hr class="ui divider"/> |
| 57 | + <div class="oauth2 center"> |
| 58 | + <div id="oauth2-login-loader" class="ui disabled centered loader"></div> |
| 59 | + <div> |
| 60 | + <div id="oauth2-login-navigator" class="gt-df gt-jc"> |
| 61 | + <span class="gt-self-center gt-mr-3">{{.locale.Tr "sign_in_with"}}</span> |
| 62 | + <div class="gt-df gt-fw gt-gap-4"> |
| 63 | + {{range $key := .OrderedOAuth2Names}} |
| 64 | + {{$provider := index $.OAuth2Providers $key}} |
| 65 | + <a class="{{$provider.Name}} silenced oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}" data-tooltip-content="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"> |
| 66 | + {{if eq $provider.Name "github"}} |
| 67 | + {{svg "octicon-mark-github" 40}} |
| 68 | + {{else if eq $provider.Name "gitlab"}} |
| 69 | + {{svg "gitea-gitlab" 40}} |
| 70 | + {{else if eq $provider.Name "openidConnect"}} |
| 71 | + {{svg "gitea-openid" 40}} |
| 72 | + {{else}} |
| 73 | + <img |
| 74 | + class="gt-object-contain" |
| 75 | + width="40" |
| 76 | + height="40" |
| 77 | + alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}" |
| 78 | + src="{{AppSubUrl}}{{$provider.Image}}" |
| 79 | + > |
71 | 80 | {{end}}
|
72 |
| - </div> |
73 |
| - </div> |
| 81 | + </a> |
| 82 | + {{end}} |
74 | 83 | </div>
|
75 | 84 | </div>
|
76 |
| - {{end}} |
77 |
| - </form> |
78 | 85 | </div>
|
| 86 | + </div> |
| 87 | + {{end}} |
| 88 | + </form> |
| 89 | +</div> |
0 commit comments