Skip to content

Commit 9a2ae75

Browse files
author
0ko
committed
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 <mahlzahn@posteo.de> Reviewed-by: Beowulf <beowulf@beocode.eu> Reviewed-by: Gusted <gusted@noreply.codeberg.org>
1 parent 6fd667d commit 9a2ae75

4 files changed

Lines changed: 16 additions & 1 deletion

File tree

templates/custom/signin_mid.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{/* Uncomment to use this example in your login screen */}}
2+
{{/*
3+
<div class="ui warning message tw-flex tw-mb-4 tw-text-start">
4+
<p>This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.</p>
5+
</div>
6+
*/}}

templates/custom/signup_top.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{{/* Uncomment to use this example in your registration form */}}
2+
{{/*
3+
<div class="ui warning message tw-flex tw-mt-0 tw-mb-4 tw-text-start">
4+
<p>This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.</p>
5+
</div>
6+
*/}}

templates/user/auth/signin_inner.tmpl

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
</h4>
1212
<div class="ui attached segment">
1313
{{if .EnableInternalSignIn}}
14-
<form class="ui form" action="{{.SignInLink}}" method="post">
14+
<form class="ui form tw-mb-4" action="{{.SignInLink}}" method="post">
1515
<div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
1616
<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
1717
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required autocorrect="off" autocapitalize="none">
@@ -45,6 +45,8 @@
4545
</form>
4646
{{end}}
4747

48+
{{template "custom/signin_mid"}}
49+
4850
{{template "user/auth/oauth_container" .}}
4951
</div>
5052
</div>

templates/user/auth/signup_inner.tmpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
{{if .DisableRegistration}}
1515
<p>{{.DisableRegistrationReason}}</p>
1616
{{else}}
17+
{{template "custom/signup_top"}}
1718
<div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
1819
<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
1920
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required autocorrect="off" autocapitalize="none">

0 commit comments

Comments
 (0)