File tree 4 files changed +41
-0
lines changed 4 files changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -392,7 +392,16 @@ func SignUp(ctx *context.Context) {
392
392
393
393
ctx .Data ["SignUpLink" ] = setting .AppSubURL + "/user/sign_up"
394
394
395
+ orderedOAuth2Names , oauth2Providers , err := oauth2 .GetActiveOAuth2Providers ()
396
+ if err != nil {
397
+ ctx .ServerError ("UserSignUp" , err )
398
+ return
399
+ }
400
+
401
+ ctx .Data ["OrderedOAuth2Names" ] = orderedOAuth2Names
402
+ ctx .Data ["OAuth2Providers" ] = oauth2Providers
395
403
context .SetCaptchaData (ctx )
404
+
396
405
ctx .Data ["PageIsSignUp" ] = true
397
406
398
407
// Show Disabled Registration message if DisableRegistration or AllowOnlyExternalRegistration options are true
@@ -413,7 +422,16 @@ func SignUpPost(ctx *context.Context) {
413
422
414
423
ctx .Data ["SignUpLink" ] = setting .AppSubURL + "/user/sign_up"
415
424
425
+ orderedOAuth2Names , oauth2Providers , err := oauth2 .GetActiveOAuth2Providers ()
426
+ if err != nil {
427
+ ctx .ServerError ("UserSignUp" , err )
428
+ return
429
+ }
430
+
431
+ ctx .Data ["OrderedOAuth2Names" ] = orderedOAuth2Names
432
+ ctx .Data ["OAuth2Providers" ] = oauth2Providers
416
433
context .SetCaptchaData (ctx )
434
+
417
435
ctx .Data ["PageIsSignUp" ] = true
418
436
419
437
// Permission denied if DisableRegistration or AllowOnlyExternalRegistration options are true
Original file line number Diff line number Diff line change 4
4
<a class="{{if .PageIsLogin}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login">
5
5
{{.locale.Tr "auth.login_userpass"}}
6
6
</a>
7
+ <a class="{{if .PageIsSignUp}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/sign_up">
8
+ {{.locale.Tr "auth.create_new_account"}}
9
+ </a>
7
10
{{if .EnableOpenIDSignIn}}
8
11
<a class="{{if .PageIsLoginOpenID}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
9
12
{{svg "fontawesome-openid"}}
Original file line number Diff line number Diff line change 1
1
{{template "base/head" .}}
2
2
<div role="main" aria-label="{{.Title}}" class="page-content user signin{{if .LinkAccountMode}} icon{{end}}">
3
+ {{template "user/auth/signin_navbar" .}}
3
4
<div class="ui middle very relaxed page grid">
4
5
{{template "user/auth/signup_inner" .}}
5
6
</div>
Original file line number Diff line number Diff line change 55
55
</div>
56
56
{{end}}
57
57
{{end}}
58
+
59
+ {{if and .OrderedOAuth2Names .OAuth2Providers}}
60
+ <div class="divider divider-text">
61
+ {{.locale.Tr "sign_in_or"}}
62
+ </div>
63
+ <div id="oauth2-login-navigator" class="gt-py-2">
64
+ <div class="gt-df gt-fc gt-jc">
65
+ <div id="oauth2-login-navigator-inner" class="gt-df gt-fc gt-fw gt-ac gt-gap-3">
66
+ {{range $key := .OrderedOAuth2Names}}
67
+ {{$provider := index $.OAuth2Providers $key}}
68
+ <a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
69
+ {{$provider.IconHTML}}
70
+ {{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
71
+ </a>
72
+ {{end}}
73
+ </div>
74
+ </div>
75
+ </div>
76
+ {{end}}
58
77
</form>
59
78
</div>
60
79
</div>
You can’t perform that action at this time.
0 commit comments