From 0e5932fcca793e6b9f24321c09ab8bb09898198b Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:10:53 -0500 Subject: [PATCH 01/17] add helper class for width --- web_src/css/helpers.css | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index da94ebb4862ed..c7d8abb1d49bc 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -48,6 +48,7 @@ Gitea's private styles use `g-` prefix. .gt-max-width-12rem { max-width: 12rem !important; } .gt-max-width-24rem { max-width: 24rem !important; } +.gt-max-width-36rem { max-width: 36rem !important; } /* below class names match Tailwind CSS */ .gt-break-all { word-break: break-all !important; } From 86f498bc20d2bc0f358573f7398575533b69066c Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:26:59 -0500 Subject: [PATCH 02/17] move labels above for sign in tmpl --- templates/user/auth/signin_inner.tmpl | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index 0d0064b02afc2..a0aea5cb9b1de 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}}
-
@@ -34,7 +33,6 @@ {{template "user/auth/captcha" .}}
-
{{else if .IsResetDisable}} From 0e5c7fd0b9f9a022a9cb1614a4d84582534bbcc6 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:27:33 -0500 Subject: [PATCH 04/17] move labels above for sign in openid tmpl --- templates/user/auth/signin_openid.tmpl | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl index 0428026aa8b5d..400f8c5033c35 100644 --- a/templates/user/auth/signin_openid.tmpl +++ b/templates/user/auth/signin_openid.tmpl @@ -8,7 +8,7 @@ OpenID
- + {{.CsrfTokenHtml}}
{{ctx.Locale.Tr "auth.openid_signin_desc"}} @@ -18,21 +18,19 @@ {{svg "fontawesome-openid"}} OpenID URI - +
-
-
-{{template "base/footer" .}} +{{template "base/footer" .}} \ No newline at end of file From eea82fe55f16a0e9e88aa452ea053fde2bf62604 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:27:47 -0500 Subject: [PATCH 05/17] move labels above for signup tmpl --- templates/user/auth/signup_inner.tmpl | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index e930bd3d158a0..e1fded787f58c 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" .}} @@ -17,28 +17,27 @@ {{else}}
- +
- +
{{if not .DisablePassword}}
- +
- +
{{end}} {{template "user/auth/captcha" .}}
-
\ No newline at end of file From a5ebb506cae32e3f2b830d47561a860c8eff4b31 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:28:06 -0500 Subject: [PATCH 06/17] move labels above for captcha tmpl --- templates/user/auth/captcha.tmpl | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl index 1c3379e62939e..ee7bed0969ec6 100644 --- a/templates/user/auth/captcha.tmpl +++ b/templates/user/auth/captcha.tmpl @@ -1,11 +1,10 @@ {{if .EnableCaptcha}}{{if eq .CaptchaType "image"}}
- {{.Captcha.CreateHTML}}
- +
{{else if eq .CaptchaType "recaptcha"}}
From ba6e24b29745c1f97bf554a0583b5f7771f509b9 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 11:39:54 -0500 Subject: [PATCH 07/17] move labels above for reset password tmpl --- templates/user/auth/reset_passwd.tmpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index 9fee30f554028..d09851480284b 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -19,11 +19,10 @@ {{if .IsResetForm}}
- +
{{if not .user_signed_in}}
-
@@ -44,13 +43,12 @@ {{else}}
- +
{{end}} {{end}}
- {{if and .has_two_factor (not .scratch_code)}} {{ctx.Locale.Tr "auth.use_scratch_code"}} From c63bfcaa803a7ca160844ecf1cfd5dab6edc1360 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 12:14:57 -0500 Subject: [PATCH 08/17] move labels above for signup openid tmpl --- templates/user/auth/signup_openid_register.tmpl | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl index 81c36957d1cfa..99b64a2e6c8c4 100644 --- a/templates/user/auth/signup_openid_register.tmpl +++ b/templates/user/auth/signup_openid_register.tmpl @@ -7,28 +7,27 @@ {{ctx.Locale.Tr "auth.openid_register_title"}}
-

+

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

{{.CsrfTokenHtml}}
- +
- +
{{template "user/auth/captcha" .}}
- +
-
From 5118fa3258651957d9775ed3b8f3d2fd3f0b2233 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 12:15:50 -0500 Subject: [PATCH 09/17] update css to ensure labels are left aligned --- web_src/css/form.css | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/web_src/css/form.css b/web_src/css/form.css index e4efa349486e0..752d1d393afbf 100644 --- a/web_src/css/form.css +++ b/web_src/css/form.css @@ -242,8 +242,6 @@ textarea:focus, .user.activate form, .user.forgot.password form, .user.reset.password form, -.user.link-account form, -.user.signin form, .user.signup form { margin: auto; width: 700px !important; @@ -275,12 +273,7 @@ textarea:focus, .user.signup form .header { padding-left: 280px !important; } - .user.activate form .inline.field > label, - .user.forgot.password form .inline.field > label, - .user.reset.password form .inline.field > label, - .user.link-account form .inline.field > label, - .user.signin form .inline.field > label, - .user.signup form .inline.field > label { + .user.activate form .inline.field > label { text-align: right; width: 250px !important; word-wrap: break-word; From a809db87140cf295253b5b510fd156332f0f1ce1 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 14:02:13 -0500 Subject: [PATCH 10/17] fix lint errors --- templates/user/auth/signin_openid.tmpl | 2 +- templates/user/auth/signup_inner.tmpl | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl index 400f8c5033c35..a138ea0b8d0bd 100644 --- a/templates/user/auth/signin_openid.tmpl +++ b/templates/user/auth/signin_openid.tmpl @@ -33,4 +33,4 @@
-{{template "base/footer" .}} \ No newline at end of file +{{template "base/footer" .}} diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index e1fded787f58c..65ce98c31ab8a 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -73,4 +73,4 @@ {{end}}
-
\ No newline at end of file +
From 47bac4fbb7be43e92f84000eda1d97dc6a8a9893 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 14:13:57 -0500 Subject: [PATCH 11/17] remove Str2html --- templates/user/auth/signin_inner.tmpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index a0aea5cb9b1de..f703a731245b5 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -45,7 +45,7 @@ {{if .ShowRegistrationButton}} {{end}} From 95c65df4746d68529c516da32052ff02e69206fa Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 26 Feb 2024 16:08:48 -0500 Subject: [PATCH 12/17] ensure forms within signin class are centered on all screens --- web_src/css/form.css | 1 + 1 file changed, 1 insertion(+) diff --git a/web_src/css/form.css b/web_src/css/form.css index 752d1d393afbf..4cd0cc24ce3bd 100644 --- a/web_src/css/form.css +++ b/web_src/css/form.css @@ -242,6 +242,7 @@ textarea:focus, .user.activate form, .user.forgot.password form, .user.reset.password form, +.user.signin form, .user.signup form { margin: auto; width: 700px !important; From 95d4253fe9811fafb56a846ed731b3cdf08e5f68 Mon Sep 17 00:00:00 2001 From: rafh Date: Fri, 1 Mar 2024 12:15:22 -0500 Subject: [PATCH 13/17] implement tailwind helper classes --- templates/user/auth/captcha.tmpl | 2 +- templates/user/auth/forgot_passwd.tmpl | 2 +- templates/user/auth/reset_passwd.tmpl | 4 ++-- templates/user/auth/signin_inner.tmpl | 8 ++++---- templates/user/auth/signin_openid.tmpl | 4 ++-- templates/user/auth/signup_inner.tmpl | 12 ++++++------ templates/user/auth/signup_openid_register.tmpl | 8 ++++---- web_src/css/helpers.css | 1 - 8 files changed, 20 insertions(+), 21 deletions(-) diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl index ee7bed0969ec6..27b3ce7e65a42 100644 --- a/templates/user/auth/captcha.tmpl +++ b/templates/user/auth/captcha.tmpl @@ -4,7 +4,7 @@
- +
{{else if eq .CaptchaType "recaptcha"}}
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl index fabd66e47fba7..4ffeae9a09cb5 100644 --- a/templates/user/auth/forgot_passwd.tmpl +++ b/templates/user/auth/forgot_passwd.tmpl @@ -14,7 +14,7 @@ {{else if .IsResetRequest}}
- +
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index d09851480284b..78d5271b5cdd3 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -19,7 +19,7 @@ {{if .IsResetForm}}
- +
{{if not .user_signed_in}}
@@ -43,7 +43,7 @@ {{else}}
- +
{{end}} {{end}} diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index f703a731245b5..baaa4f5322b1d 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -9,16 +9,16 @@ {{end}}
-
+ {{.CsrfTokenHtml}}
- +
{{if or (not .DisablePassword) .LinkAccountMode}}
- +
{{end}} {{if not .LinkAccountMode}} @@ -57,7 +57,7 @@
{{range $provider := .OAuth2Providers}} - diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl index a138ea0b8d0bd..d86fc09d10569 100644 --- a/templates/user/auth/signin_openid.tmpl +++ b/templates/user/auth/signin_openid.tmpl @@ -8,7 +8,7 @@ OpenID
- + {{.CsrfTokenHtml}}
{{ctx.Locale.Tr "auth.openid_signin_desc"}} @@ -18,7 +18,7 @@ {{svg "fontawesome-openid"}} OpenID URI - +
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index 65ce98c31ab8a..ca79d15dfbc47 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" .}} @@ -17,21 +17,21 @@ {{else}}
- +
- +
{{if not .DisablePassword}}
- +
- +
{{end}} @@ -62,7 +62,7 @@
{{range $provider := .OAuth2Providers}} - diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl index 99b64a2e6c8c4..0363e108a11a5 100644 --- a/templates/user/auth/signup_openid_register.tmpl +++ b/templates/user/auth/signup_openid_register.tmpl @@ -7,25 +7,25 @@ {{ctx.Locale.Tr "auth.openid_register_title"}}
-

+

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

{{.CsrfTokenHtml}}
- +
- +
{{template "user/auth/captcha" .}}
- +
diff --git a/web_src/css/helpers.css b/web_src/css/helpers.css index 0314f3d841055..3579c193b1c07 100644 --- a/web_src/css/helpers.css +++ b/web_src/css/helpers.css @@ -48,7 +48,6 @@ Gitea's private styles use `g-` prefix. .gt-max-width-12rem { max-width: 12rem !important; } .gt-max-width-24rem { max-width: 24rem !important; } -.gt-max-width-36rem { max-width: 36rem !important; } /* below class names match Tailwind CSS */ .gt-break-all { word-break: break-all !important; } From ca237d060f9483873a8e4066cb0e198c35454251 Mon Sep 17 00:00:00 2001 From: rafh Date: Fri, 1 Mar 2024 12:58:28 -0500 Subject: [PATCH 14/17] remove helper classes and remove inline class --- templates/user/auth/captcha.tmpl | 4 ++-- templates/user/auth/forgot_passwd.tmpl | 4 ++-- templates/user/auth/reset_passwd.tmpl | 8 ++++---- templates/user/auth/signin_inner.tmpl | 14 +++++++------- templates/user/auth/signin_openid.tmpl | 4 ++-- templates/user/auth/signup_inner.tmpl | 18 +++++++++--------- .../user/auth/signup_openid_register.tmpl | 12 ++++++------ 7 files changed, 32 insertions(+), 32 deletions(-) diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl index 27b3ce7e65a42..2c15d8ab7fc90 100644 --- a/templates/user/auth/captcha.tmpl +++ b/templates/user/auth/captcha.tmpl @@ -2,9 +2,9 @@
{{.Captcha.CreateHTML}}
-
+
- +
{{else if eq .CaptchaType "recaptcha"}}
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl index 4ffeae9a09cb5..55bcf63018393 100644 --- a/templates/user/auth/forgot_passwd.tmpl +++ b/templates/user/auth/forgot_passwd.tmpl @@ -12,9 +12,9 @@ {{if .IsResetSent}}

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

{{else if .IsResetRequest}} -
+
- +
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl index 78d5271b5cdd3..4d569e206c0e6 100644 --- a/templates/user/auth/reset_passwd.tmpl +++ b/templates/user/auth/reset_passwd.tmpl @@ -17,9 +17,9 @@
{{end}} {{if .IsResetForm}} -
+
- +
{{if not .user_signed_in}}
@@ -41,9 +41,9 @@
{{else}} -
+
- +
{{end}} {{end}} diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index baaa4f5322b1d..7a6b5e292c7fc 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -9,16 +9,16 @@ {{end}}
- + {{.CsrfTokenHtml}} -
+
- +
{{if or (not .DisablePassword) .LinkAccountMode}} -
+
- +
{{end}} {{if not .LinkAccountMode}} @@ -32,7 +32,7 @@ {{template "user/auth/captcha" .}} -
+
{{if .ShowRegistrationButton}} -
+ {{end}} diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl index d86fc09d10569..c1f392dc134df 100644 --- a/templates/user/auth/signin_openid.tmpl +++ b/templates/user/auth/signin_openid.tmpl @@ -13,12 +13,12 @@
{{ctx.Locale.Tr "auth.openid_signin_desc"}}
-
+
- +
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index ca79d15dfbc47..3478fa9f7c7e6 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,23 +15,23 @@ {{if .DisableRegistration}}

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

{{else}} -
+
- +
-
+
- +
{{if not .DisablePassword}} -
+
- +
-
+
- +
{{end}} diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl index 0363e108a11a5..c017a0e65b26a 100644 --- a/templates/user/auth/signup_openid_register.tmpl +++ b/templates/user/auth/signup_openid_register.tmpl @@ -12,20 +12,20 @@

{{.CsrfTokenHtml}} -
+
- +
-
+
- +
{{template "user/auth/captcha" .}} -
+
- +
From 7b245a78838c61276f5e4a94e548c66e577c4757 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 4 Mar 2024 18:11:43 -0500 Subject: [PATCH 15/17] top align labels for activate tmpl --- templates/user/auth/activate.tmpl | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl index e32a5d8707356..ac928935ac277 100644 --- a/templates/user/auth/activate.tmpl +++ b/templates/user/auth/activate.tmpl @@ -10,12 +10,11 @@
{{template "base/alert" .}} {{if .NeedVerifyLocalPassword}} -
+
-
@@ -29,7 +28,7 @@
-
+
{{end}} From 731a104ec506ea041b0b6e3a956fbf283dfbfe26 Mon Sep 17 00:00:00 2001 From: rafh Date: Mon, 4 Mar 2024 19:06:31 -0500 Subject: [PATCH 16/17] update tmpl to use a unified approach to form width --- templates/user/auth/change_passwd_inner.tmpl | 7 +++---- templates/user/auth/signin_inner.tmpl | 2 +- templates/user/auth/signup_inner.tmpl | 2 +- templates/user/auth/twofa.tmpl | 5 ++--- templates/user/auth/twofa_scratch.tmpl | 5 ++--- web_src/css/form.css | 1 - 6 files changed, 9 insertions(+), 13 deletions(-) diff --git a/templates/user/auth/change_passwd_inner.tmpl b/templates/user/auth/change_passwd_inner.tmpl index cffc798a64a74..01bbf500e5c6a 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/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index 7a6b5e292c7fc..d7d3649a4d7b3 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -9,7 +9,7 @@ {{end}}
-
+ {{.CsrfTokenHtml}}
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index 3478fa9f7c7e6..cfd826a0ce210 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" .}} diff --git a/templates/user/auth/twofa.tmpl b/templates/user/auth/twofa.tmpl index 5260178d13790..d24523917158b 100644 --- a/templates/user/auth/twofa.tmpl +++ b/templates/user/auth/twofa.tmpl @@ -2,20 +2,19 @@