Skip to content

Commit e16b0e5

Browse files
unify layout between auth pages (#13547)
Co-authored-by: techknowlogick <[email protected]>
1 parent 5c76c5c commit e16b0e5

File tree

6 files changed

+94
-96
lines changed

6 files changed

+94
-96
lines changed

templates/user/auth/link_account.tmpl

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,20 @@
11
{{template "base/head" .}}
22

33
<div class="user link-account">
4+
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
5+
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
6+
<a class="item {{if not .user_exists}}active{{end}}"
7+
data-tab="auth-link-signup-tab">
8+
{{.i18n.Tr "auth.oauth_signup_tab"}}
9+
</a>
10+
<a class="item {{if .user_exists}}active{{end}}"
11+
data-tab="auth-link-signin-tab">
12+
{{.i18n.Tr "auth.oauth_signin_tab"}}
13+
</a>
14+
</div>
15+
416
<div class="ui middle very relaxed page grid">
517
<div class="column">
6-
7-
<div class="ui tabular menu">
8-
<!-- TODO handle .ShowRegistrationButton once other login bugs are fixed -->
9-
<div class="item {{if not .user_exists}}active{{end}}"
10-
data-tab="auth-link-signup-tab">
11-
{{.i18n.Tr "auth.oauth_signup_tab"}}
12-
</div>
13-
<div class="item {{if .user_exists}}active{{end}}"
14-
data-tab="auth-link-signin-tab">
15-
{{.i18n.Tr "auth.oauth_signin_tab"}}
16-
</div>
17-
</div>
18-
1918
<div class="ui tab {{if not .user_exists}}active{{end}}"
2019
data-tab="auth-link-signup-tab">
2120
{{template "user/auth/signup_inner" .}}

templates/user/auth/signin.tmpl

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
{{template "base/head" .}}
22
<div class="user signin{{if .LinkAccountMode}} icon{{end}}">
33
{{template "user/auth/signin_navbar" .}}
4-
<div class="ui container">
5-
{{template "user/auth/signin_inner" .}}
4+
<div class="ui middle very relaxed page grid">
5+
<div class="ui container column">
6+
{{template "user/auth/signin_inner" .}}
7+
</div>
68
</div>
79
</div>
810
{{template "base/footer" .}}

templates/user/auth/signup.tmpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
{{template "base/head" .}}
2-
{{template "user/auth/signup_inner" .}}
2+
<div class="user signin{{if .LinkAccountMode}} icon{{end}}">
3+
<div class="ui middle very relaxed page grid">
4+
{{template "user/auth/signup_inner" .}}
5+
</div>
6+
</div>
37
{{template "base/footer" .}}

templates/user/auth/signup_inner.tmpl

Lines changed: 72 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,78 @@
1-
<div class="user signup{{if .LinkAccountMode}} icon{{end}}">
2-
<div class="ui middle very relaxed page grid">
3-
<div class="column">
4-
<form class="ui form" action="{{.SignUpLink}}" method="post">
5-
{{.CsrfTokenHtml}}
6-
<h3 class="ui top attached header">
7-
{{if .LinkAccountMode}}
8-
{{.i18n.Tr "auth.oauth_signup_title"}}
9-
{{else}}
10-
{{.i18n.Tr "sign_up"}}
11-
{{end}}
12-
</h3>
13-
<div class="ui attached segment">
14-
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
15-
{{template "base/alert" .}}
16-
{{end}}
17-
{{if .DisableRegistration}}
18-
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
19-
{{else}}
20-
<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
21-
<label for="user_name">{{.i18n.Tr "username"}}</label>
22-
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
23-
</div>
24-
<div class="required inline field {{if .Err_Email}}error{{end}}">
25-
<label for="email">{{.i18n.Tr "email"}}</label>
26-
<input id="email" name="email" type="email" value="{{.email}}" required>
27-
</div>
28-
29-
{{if not .DisablePassword}}
30-
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
31-
<label for="password">{{.i18n.Tr "password"}}</label>
32-
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
33-
</div>
34-
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
35-
<label for="retype">{{.i18n.Tr "re_type"}}</label>
36-
<input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
37-
</div>
38-
{{end}}
39-
{{if and .EnableCaptcha (eq .CaptchaType "image")}}
40-
<div class="inline field">
41-
<label></label>
42-
{{.Captcha.CreateHtml}}
43-
</div>
44-
<div class="required inline field {{if .Err_Captcha}}error{{end}}">
45-
<label for="captcha">{{.i18n.Tr "captcha"}}</label>
46-
<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
47-
</div>
48-
{{end}}
49-
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
50-
<div class="inline field required">
51-
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
52-
</div>
53-
{{end}}
54-
{{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
55-
<div class="inline field required">
56-
<div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div>
57-
</div>
58-
{{end}}
1+
<div class="ui container column{{if .LinkAccountMode}} icon{{end}}">
2+
<h4 class="ui top attached header center">
3+
{{if .LinkAccountMode}}
4+
{{.i18n.Tr "auth.oauth_signup_title"}}
5+
{{else}}
6+
{{.i18n.Tr "sign_up"}}
7+
{{end}}
8+
</h4>
9+
<div class="ui attached segment">
10+
<form class="ui form" action="{{.SignUpLink}}" method="post">
11+
{{.CsrfTokenHtml}}
12+
{{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}}
13+
{{template "base/alert" .}}
14+
{{end}}
15+
{{if .DisableRegistration}}
16+
<p>{{.i18n.Tr "auth.disable_register_prompt"}}</p>
17+
{{else}}
18+
<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
19+
<label for="user_name">{{.i18n.Tr "username"}}</label>
20+
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
21+
</div>
22+
<div class="required inline field {{if .Err_Email}}error{{end}}">
23+
<label for="email">{{.i18n.Tr "email"}}</label>
24+
<input id="email" name="email" type="email" value="{{.email}}" required>
25+
</div>
5926

60-
<div class="inline field">
61-
<label></label>
62-
<button class="ui green button">
63-
{{if .LinkAccountMode}}
64-
{{.i18n.Tr "auth.oauth_signup_submit"}}
65-
{{else}}
66-
{{.i18n.Tr "auth.create_new_account"}}
67-
{{end}}
68-
</button>
69-
</div>
27+
{{if not .DisablePassword}}
28+
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
29+
<label for="password">{{.i18n.Tr "password"}}</label>
30+
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
31+
</div>
32+
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
33+
<label for="retype">{{.i18n.Tr "re_type"}}</label>
34+
<input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
35+
</div>
36+
{{end}}
37+
{{if and .EnableCaptcha (eq .CaptchaType "image")}}
38+
<div class="inline field">
39+
<label></label>
40+
{{.Captcha.CreateHtml}}
41+
</div>
42+
<div class="required inline field {{if .Err_Captcha}}error{{end}}">
43+
<label for="captcha">{{.i18n.Tr "captcha"}}</label>
44+
<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
45+
</div>
46+
{{end}}
47+
{{if and .EnableCaptcha (eq .CaptchaType "recaptcha")}}
48+
<div class="inline field required">
49+
<div class="g-recaptcha" data-sitekey="{{ .RecaptchaSitekey }}"></div>
50+
</div>
51+
{{end}}
52+
{{if and .EnableCaptcha (eq .CaptchaType "hcaptcha")}}
53+
<div class="inline field required">
54+
<div class="h-captcha" data-sitekey="{{ .HcaptchaSitekey }}"></div>
55+
</div>
56+
{{end}}
7057

71-
{{if not .LinkAccountMode}}
72-
<div class="inline field">
73-
<label></label>
74-
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
75-
</div>
58+
<div class="inline field">
59+
<label></label>
60+
<button class="ui green button">
61+
{{if .LinkAccountMode}}
62+
{{.i18n.Tr "auth.oauth_signup_submit"}}
63+
{{else}}
64+
{{.i18n.Tr "auth.create_new_account"}}
7665
{{end}}
77-
{{end}}
66+
</button>
67+
</div>
68+
69+
{{if not .LinkAccountMode}}
70+
<div class="inline field">
71+
<label></label>
72+
<a href="{{AppSubUrl}}/user/login">{{.i18n.Tr "auth.register_helper_msg"}}</a>
7873
</div>
79-
</form>
80-
</div>
74+
{{end}}
75+
{{end}}
76+
</form>
8177
</div>
8278
</div>

web_src/less/_form.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ textarea:focus,
232232
.user.activate,
233233
.user.forgot.password,
234234
.user.reset.password,
235+
.user.link-account,
235236
.user.signin,
236237
.user.signup {
237238
@input-padding: 200px;

web_src/less/_home.less

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
}
5050
}
5151

52-
.signup {
53-
padding-top: 15px;
54-
}
55-
5652
footer {
5753
.ui.container .left,
5854
.ui.container .right {

0 commit comments

Comments
 (0)