mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2026-07-13 04:58:46 +00:00
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:  Login screen examples: ||| |-|-| 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>
This commit is contained in:
parent
6fd667dcd8
commit
9a2ae75a43
4 changed files with 16 additions and 1 deletions
6
templates/custom/signin_mid.tmpl
Normal file
6
templates/custom/signin_mid.tmpl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{{/* Uncomment to use this example in your login screen */}}
|
||||
{{/*
|
||||
<div class="ui warning message tw-flex tw-mb-4 tw-text-start">
|
||||
<p>This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.</p>
|
||||
</div>
|
||||
*/}}
|
||||
6
templates/custom/signup_top.tmpl
Normal file
6
templates/custom/signup_top.tmpl
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
{{/* Uncomment to use this example in your registration form */}}
|
||||
{{/*
|
||||
<div class="ui warning message tw-flex tw-mt-0 tw-mb-4 tw-text-start">
|
||||
<p>This instance is being used for community development of SomeGreatSoftwareName and software within its ecosystem. Unrelated repositories will be removed.</p>
|
||||
</div>
|
||||
*/}}
|
||||
|
|
@ -11,7 +11,7 @@
|
|||
</h4>
|
||||
<div class="ui attached segment">
|
||||
{{if .EnableInternalSignIn}}
|
||||
<form class="ui form" action="{{.SignInLink}}" method="post">
|
||||
<form class="ui form tw-mb-4" action="{{.SignInLink}}" method="post">
|
||||
<div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
|
||||
<label for="user_name">{{ctx.Locale.Tr "home.uname_holder"}}</label>
|
||||
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required autocorrect="off" autocapitalize="none">
|
||||
|
|
@ -45,6 +45,8 @@
|
|||
</form>
|
||||
{{end}}
|
||||
|
||||
{{template "custom/signin_mid"}}
|
||||
|
||||
{{template "user/auth/oauth_container" .}}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
{{if .DisableRegistration}}
|
||||
<p>{{.DisableRegistrationReason}}</p>
|
||||
{{else}}
|
||||
{{template "custom/signup_top"}}
|
||||
<div class="required field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
|
||||
<label for="user_name">{{ctx.Locale.Tr "username"}}</label>
|
||||
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required autocorrect="off" autocapitalize="none">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue