From c996e359585597d8c86e57edf91ada1564e5106c Mon Sep 17 00:00:00 2001 From: Rafael Heard Date: Wed, 6 Mar 2024 09:20:26 -0500 Subject: [PATCH] Move all login and account creation page labels to be above inputs (#29432) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are a few inconsistencies within Gitea and this PR addresses one of them. This PR updates the sign-in page layout, including the register and openID tabs, to match the layout of the settings pages (/user/settings) for more consistency. This PR updates the following routes: `/user/login` `/user/sign_up` `/user/login/openid` `/user/forgot_password` `/user/link_account` `/user/recover_account` **Before** Screenshot 2024-02-05 at 8 27 24 AM **After** Screenshot 2024-02-05 at 8 26 39 AM This PR addresses a revert of the original PR due to this [comment](https://github.com/go-gitea/gitea/pull/28753#issuecomment-1956596817). --------- Co-authored-by: rafh --- templates/user/auth/activate.tmpl | 7 +++---- templates/user/auth/captcha.tmpl | 3 +-- templates/user/auth/change_passwd_inner.tmpl | 7 +++---- templates/user/auth/forgot_passwd.tmpl | 3 +-- templates/user/auth/prohibit_login.tmpl | 2 +- templates/user/auth/reset_passwd.tmpl | 6 ++---- templates/user/auth/signin_inner.tmpl | 15 ++++++--------- templates/user/auth/signin_openid.tmpl | 6 ++---- templates/user/auth/signup_inner.tmpl | 14 ++++++-------- templates/user/auth/signup_openid_register.tmpl | 9 ++++----- templates/user/auth/twofa.tmpl | 5 ++--- templates/user/auth/twofa_scratch.tmpl | 5 ++--- web_src/css/form.css | 10 +--------- 13 files changed, 34 insertions(+), 58 deletions(-) diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl index e32a5d8707..7f8ff0eb5a 100644 --- a/templates/user/auth/activate.tmpl +++ b/templates/user/auth/activate.tmpl @@ -2,7 +2,7 @@
-
+ {{.CsrfTokenHtml}}

{{ctx.Locale.Tr "auth.active_your_account"}} @@ -10,12 +10,11 @@
{{template "base/alert" .}} {{if .NeedVerifyLocalPassword}} -
+
-
@@ -29,7 +28,7 @@
-
+
{{end}} diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl index d4d1a82418..0e9c2b9d22 100644 --- a/templates/user/auth/captcha.tmpl +++ b/templates/user/auth/captcha.tmpl @@ -1,9 +1,8 @@ {{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
- {{.Captcha.CreateHTML}}
-
+
diff --git a/templates/user/auth/change_passwd_inner.tmpl b/templates/user/auth/change_passwd_inner.tmpl index cffc798a64..01bbf500e5 100644 --- a/templates/user/auth/change_passwd_inner.tmpl +++ b/templates/user/auth/change_passwd_inner.tmpl @@ -5,18 +5,17 @@ {{ctx.Locale.Tr "settings.change_password"}}

- + {{.CsrfTokenHtml}} -
+
-
+
-
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl index 21a630ec5e..55bcf63018 100644 --- a/templates/user/auth/forgot_passwd.tmpl +++ b/templates/user/auth/forgot_passwd.tmpl @@ -12,13 +12,12 @@ {{if .IsResetSent}}

{{ctx.Locale.Tr "auth.reset_password_mail_sent_prompt" .Email .ResetPwdCodeLives}}

{{else if .IsResetRequest}} -
+
-
{{else if .IsResetDisable}} diff --git a/templates/user/auth/prohibit_login.tmpl b/templates/user/auth/prohibit_login.tmpl index 668aa20e71..962ddfa98c 100644 --- a/templates/user/auth/prohibit_login.tmpl +++ b/templates/user/auth/prohibit_login.tmpl @@ -2,7 +2,7 @@
-
+

{{ctx.Locale.Tr "auth.prohibit_login"}}

diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index 9fee30f554..4d569e206c 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -17,13 +17,12 @@
{{end}} {{if .IsResetForm}} -
+
{{if not .user_signed_in}}
-
@@ -42,7 +41,7 @@
{{else}} -
+
@@ -50,7 +49,6 @@ {{end}}
- {{if and .has_two_factor (not .scratch_code)}} {{ctx.Locale.Tr "auth.use_scratch_code"}} diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index 0d0064b02a..d7d3649a4d 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -9,21 +9,20 @@ {{end}}
- + {{.CsrfTokenHtml}} -
+
{{if or (not .DisablePassword) .LinkAccountMode}} -
+
{{end}} {{if not .LinkAccountMode}}
-
@@ -33,8 +32,7 @@ {{template "user/auth/captcha" .}} -
- +
{{if .ShowRegistrationButton}} -
- + {{end}} @@ -60,7 +57,7 @@
{{range $provider := .OAuth2Providers}} - diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl index 0428026aa8..c1f392dc13 100644 --- a/templates/user/auth/signin_openid.tmpl +++ b/templates/user/auth/signin_openid.tmpl @@ -8,12 +8,12 @@ OpenID
- + {{.CsrfTokenHtml}}
{{ctx.Locale.Tr "auth.openid_signin_desc"}}
-
+
-
-
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index e930bd3d15..cfd826a0ce 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -7,7 +7,7 @@ {{end}}
-
+ {{.CsrfTokenHtml}} {{if or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister)}} {{template "base/alert" .}} @@ -15,21 +15,21 @@ {{if .DisableRegistration}}

{{ctx.Locale.Tr "auth.disable_register_prompt"}}

{{else}} -
+
-
+
{{if not .DisablePassword}} -
+
-
+
@@ -38,7 +38,6 @@ {{template "user/auth/captcha" .}}
-
diff --git a/templates/user/auth/twofa.tmpl b/templates/user/auth/twofa.tmpl index 5260178d13..d245239171 100644 --- a/templates/user/auth/twofa.tmpl +++ b/templates/user/auth/twofa.tmpl @@ -2,20 +2,19 @@