From 9a2ae75a43109a54c8277a86e7a3c73b34582a98 Mon Sep 17 00:00:00 2001 From: 0ko <0ko@noreply.codeberg.org> Date: Thu, 21 May 2026 06:04:41 +0200 Subject: [PATCH] feat(ui): provide ability to add a warning message to the registration/login screens (#12597) Example for how that would look like on code.forgejo.org: ![img](/attachments/eff849d5-4269-4c26-b742-b525de7709d1) Login screen examples: |![1](/attachments/78c23389-7bbd-490d-967a-da87d451c199)|![2](/attachments/c4693cd3-2616-4396-92e3-f22dbe8a0103)| |-|-| Many instances would benefit from being able to communicate such information before a user signs up or logs in after a long break. ## Testing Disabled unless admin explicitly decides to create a template override, nothing to test. In theory CSS could break but IDK how to test against that given the custom template requirement. Also need to know that template customizations are provided as-is and shift all accountability of maintaining them to admins. ## Documentation https://codeberg.org/forgejo/docs/pulls/1945 Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/12597 Reviewed-by: Robert Wolff Reviewed-by: Beowulf Reviewed-by: Gusted --- templates/custom/signin_mid.tmpl | 6 ++++++ templates/custom/signup_top.tmpl | 6 ++++++ templates/user/auth/signin_inner.tmpl | 4 +++- templates/user/auth/signup_inner.tmpl | 1 + 4 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 templates/custom/signin_mid.tmpl create mode 100644 templates/custom/signup_top.tmpl diff --git a/templates/custom/signin_mid.tmpl b/templates/custom/signin_mid.tmpl new file mode 100644 index 0000000000..0c1f204be6 --- /dev/null +++ b/templates/custom/signin_mid.tmpl @@ -0,0 +1,6 @@ +{{/* Uncomment to use this example in your login screen */}} +{{/* +
+

This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.

+
+*/}} \ No newline at end of file diff --git a/templates/custom/signup_top.tmpl b/templates/custom/signup_top.tmpl new file mode 100644 index 0000000000..e179322632 --- /dev/null +++ b/templates/custom/signup_top.tmpl @@ -0,0 +1,6 @@ +{{/* Uncomment to use this example in your registration form */}} +{{/* +
+

This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.

+
+*/}} \ No newline at end of file diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl index db705c4777..e6658120bd 100644 --- a/templates/user/auth/signin_inner.tmpl +++ b/templates/user/auth/signin_inner.tmpl @@ -11,7 +11,7 @@
{{if .EnableInternalSignIn}} -
+
@@ -45,6 +45,8 @@ {{end}} + {{template "custom/signin_mid"}} + {{template "user/auth/oauth_container" .}}
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl index b9cfff4b0b..5e83c14e33 100644 --- a/templates/user/auth/signup_inner.tmpl +++ b/templates/user/auth/signup_inner.tmpl @@ -14,6 +14,7 @@ {{if .DisableRegistration}}

{{.DisableRegistrationReason}}

{{else}} + {{template "custom/signup_top"}}