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 e32a5d870..7f8ff0eb5 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 d4d1a8241..0e9c2b9d2 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 cffc798a6..01bbf500e 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 21a630ec5..55bcf6301 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 668aa20e7..962ddfa98 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 9fee30f55..4d569e206 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 0d0064b02..d7d3649a4 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 0428026aa..c1f392dc1 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 e930bd3d1..cfd826a0c 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 5260178d1..d24523917 100644 --- a/templates/user/auth/twofa.tmpl +++ b/templates/user/auth/twofa.tmpl @@ -2,20 +2,19 @@