aboutsummaryrefslogtreecommitdiffstats
path: root/templates/user/auth
diff options
context:
space:
mode:
authordelvh <dev.lh@web.de>2023-09-25 10:56:50 +0200
committerGitHub <noreply@github.com>2023-09-25 08:56:50 +0000
commit7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e (patch)
treecfcc4836ba1bb71518742f2aaf980f1f34248468 /templates/user/auth
parente6d8b146207de0f5d88b7c08dc75b1f2f078cbbe (diff)
downloadgitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.tar.gz
gitea-7960ba7e2bbe2eb6f98f6d99f2ce105468cdf56e.zip
Always use `ctx.Locale.Tr` inside templates (#27231)
Diffstat (limited to 'templates/user/auth')
-rw-r--r--templates/user/auth/activate.tmpl24
-rw-r--r--templates/user/auth/captcha.tmpl2
-rw-r--r--templates/user/auth/change_passwd_inner.tmpl8
-rw-r--r--templates/user/auth/finalize_openid.tmpl14
-rw-r--r--templates/user/auth/forgot_passwd.tmpl14
-rw-r--r--templates/user/auth/grant.tmpl10
-rw-r--r--templates/user/auth/grant_error.tmpl4
-rw-r--r--templates/user/auth/link_account.tmpl4
-rw-r--r--templates/user/auth/prohibit_login.tmpl4
-rw-r--r--templates/user/auth/reset_passwd.tmpl22
-rw-r--r--templates/user/auth/signin_inner.tmpl22
-rw-r--r--templates/user/auth/signin_navbar.tmpl4
-rw-r--r--templates/user/auth/signin_openid.tmpl6
-rw-r--r--templates/user/auth/signup_inner.tmpl24
-rw-r--r--templates/user/auth/signup_openid_connect.tmpl12
-rw-r--r--templates/user/auth/signup_openid_navbar.tmpl4
-rw-r--r--templates/user/auth/signup_openid_register.tmpl10
-rw-r--r--templates/user/auth/twofa.tmpl8
-rw-r--r--templates/user/auth/twofa_scratch.tmpl6
-rw-r--r--templates/user/auth/webauthn.tmpl10
-rw-r--r--templates/user/auth/webauthn_error.tmpl16
21 files changed, 114 insertions, 114 deletions
diff --git a/templates/user/auth/activate.tmpl b/templates/user/auth/activate.tmpl
index 3261836ee0..1b06719753 100644
--- a/templates/user/auth/activate.tmpl
+++ b/templates/user/auth/activate.tmpl
@@ -5,42 +5,42 @@
<form class="ui form ignore-dirty" action="{{AppSubUrl}}/user/activate" method="post">
{{.CsrfTokenHtml}}
<h2 class="ui top attached header">
- {{.locale.Tr "auth.active_your_account"}}
+ {{ctx.Locale.Tr "auth.active_your_account"}}
</h2>
<div class="ui attached segment">
{{template "base/alert" .}}
{{if .IsActivatePage}}
{{if .ServiceNotEnabled}}
- <p class="center">{{.locale.Tr "auth.disable_register_mail"}}</p>
+ <p class="center">{{ctx.Locale.Tr "auth.disable_register_mail"}}</p>
{{else if .ResendLimited}}
- <p class="center">{{.locale.Tr "auth.resent_limit_prompt"}}</p>
+ <p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
{{else}}
- <p>{{.locale.Tr "auth.confirmation_mail_sent_prompt" (.SignedUser.Email|Escape) .ActiveCodeLives | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.SignedUser.Email|Escape) .ActiveCodeLives | Str2html}}</p>
{{end}}
{{else}}
{{if .NeedsPassword}}
<div class="required inline field">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" autocomplete="off" required>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "install.confirm_password"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "install.confirm_password"}}</button>
</div>
<input id="code" name="code" type="hidden" value="{{.Code}}">
{{else if .IsSendRegisterMail}}
- <p>{{.locale.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "auth.confirmation_mail_sent_prompt" (.Email|Escape) .ActiveCodeLives | Str2html}}</p>
{{else if .IsCodeInvalid}}
- <p>{{.locale.Tr "auth.invalid_code"}}</p>
+ <p>{{ctx.Locale.Tr "auth.invalid_code"}}</p>
{{else if .IsPasswordInvalid}}
- <p>{{.locale.Tr "auth.invalid_password"}}</p>
+ <p>{{ctx.Locale.Tr "auth.invalid_password"}}</p>
{{else if .ManualActivationOnly}}
- <p class="center">{{.locale.Tr "auth.manual_activation_only"}}</p>
+ <p class="center">{{ctx.Locale.Tr "auth.manual_activation_only"}}</p>
{{else}}
- <p>{{.locale.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape) | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "auth.has_unconfirmed_mail" (.SignedUser.Name|Escape) (.SignedUser.Email|Escape) | Str2html}}</p>
<div class="divider"></div>
<div class="text right">
- <button class="ui primary button">{{.locale.Tr "auth.resend_mail"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.resend_mail"}}</button>
</div>
{{end}}
{{end}}
diff --git a/templates/user/auth/captcha.tmpl b/templates/user/auth/captcha.tmpl
index f864aa1d37..c4e58d0134 100644
--- a/templates/user/auth/captcha.tmpl
+++ b/templates/user/auth/captcha.tmpl
@@ -4,7 +4,7 @@
{{.Captcha.CreateHTML}}
</div>
<div class="required inline field {{if .Err_Captcha}}error{{end}}">
- <label for="captcha">{{.locale.Tr "captcha"}}</label>
+ <label for="captcha">{{ctx.Locale.Tr "captcha"}}</label>
<input id="captcha" name="captcha" value="{{.captcha}}" autocomplete="off">
</div>
{{else if eq .CaptchaType "recaptcha"}}
diff --git a/templates/user/auth/change_passwd_inner.tmpl b/templates/user/auth/change_passwd_inner.tmpl
index 317a031f6b..cffc798a64 100644
--- a/templates/user/auth/change_passwd_inner.tmpl
+++ b/templates/user/auth/change_passwd_inner.tmpl
@@ -2,22 +2,22 @@
{{template "base/alert" .}}
{{end}}
<h4 class="ui top attached header center">
- {{.locale.Tr "settings.change_password"}}
+ {{ctx.Locale.Tr "settings.change_password"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.ChangePasscodeLink}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
</div>
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
- <label for="retype">{{.locale.Tr "re_type"}}</label>
+ <label for="retype">{{ctx.Locale.Tr "re_type"}}</label>
<input id="retype" name="retype" type="password" autocomplete="new-password" required>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "settings.change_password"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "settings.change_password"}}</button>
</div>
</form>
</div>
diff --git a/templates/user/auth/finalize_openid.tmpl b/templates/user/auth/finalize_openid.tmpl
index e81a565507..7449e3beda 100644
--- a/templates/user/auth/finalize_openid.tmpl
+++ b/templates/user/auth/finalize_openid.tmpl
@@ -6,36 +6,36 @@
<div class="twelve wide column content">
{{template "base/alert" .}}
<h4 class="ui top attached header">
- {{.locale.Tr "auth.login_userpass"}}
+ {{ctx.Locale.Tr "auth.login_userpass"}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
- <label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+ <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>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
</div>
<div class="inline field">
<label></label>
<div class="ui checkbox">
- <label>{{.locale.Tr "auth.remember_me"}}</label>
+ <label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
- <a href="{{AppSubUrl}}/user/forget_password">{{.locale.Tr "auth.forget_password"}}</a>
+ <button class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</button>
+ <a href="{{AppSubUrl}}/user/forget_password">{{ctx.Locale.Tr "auth.forget_password"}}</a>
</div>
{{if .ShowRegistrationButton}}
<div class="inline field">
<label></label>
- <a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a>
+ <a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now" | Str2html}}</a>
</div>
{{end}}
</form>
diff --git a/templates/user/auth/forgot_passwd.tmpl b/templates/user/auth/forgot_passwd.tmpl
index 38d15c20d3..dde4c8f6fe 100644
--- a/templates/user/auth/forgot_passwd.tmpl
+++ b/templates/user/auth/forgot_passwd.tmpl
@@ -5,32 +5,32 @@
<form class="ui form ignore-dirty" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h2 class="ui top attached header">
- {{.locale.Tr "auth.forgot_password_title"}}
+ {{ctx.Locale.Tr "auth.forgot_password_title"}}
</h2>
<div class="ui attached segment">
{{template "base/alert" .}}
{{if .IsResetSent}}
- <p>{{.locale.Tr "auth.reset_password_mail_sent_prompt" (Escape .Email) .ResetPwdCodeLives | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "auth.reset_password_mail_sent_prompt" (Escape .Email) .ResetPwdCodeLives | Str2html}}</p>
{{else if .IsResetRequest}}
<div class="required inline field {{if .Err_Email}}error{{end}}">
- <label for="email">{{.locale.Tr "email"}}</label>
+ <label for="email">{{ctx.Locale.Tr "email"}}</label>
<input id="email" name="email" type="email" value="{{.Email}}" autofocus required>
</div>
<div class="divider"></div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.send_reset_mail"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.send_reset_mail"}}</button>
</div>
{{else if .IsResetDisable}}
<p class="center">
{{if $.IsAdmin}}
- {{.locale.Tr "auth.disable_forgot_password_mail_admin"}}
+ {{ctx.Locale.Tr "auth.disable_forgot_password_mail_admin"}}
{{else}}
- {{.locale.Tr "auth.disable_forgot_password_mail"}}
+ {{ctx.Locale.Tr "auth.disable_forgot_password_mail"}}
{{end}}
</p>
{{else if .ResendLimited}}
- <p class="center">{{.locale.Tr "auth.resent_limit_prompt"}}</p>
+ <p class="center">{{ctx.Locale.Tr "auth.resent_limit_prompt"}}</p>
{{end}}
</div>
</form>
diff --git a/templates/user/auth/grant.tmpl b/templates/user/auth/grant.tmpl
index 28c5740be0..9d80026916 100644
--- a/templates/user/auth/grant.tmpl
+++ b/templates/user/auth/grant.tmpl
@@ -3,17 +3,17 @@
<div class="column seven wide">
<div class="ui middle centered raised segments">
<h3 class="ui top attached header">
- {{.locale.Tr "auth.authorize_title" .Application.Name}}
+ {{ctx.Locale.Tr "auth.authorize_title" .Application.Name}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<p>
- <b>{{.locale.Tr "auth.authorize_application_description"}}</b><br>
- {{.locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML | Str2html}}
+ <b>{{ctx.Locale.Tr "auth.authorize_application_description"}}</b><br>
+ {{ctx.Locale.Tr "auth.authorize_application_created_by" .ApplicationCreatorLinkHTML | Str2html}}
</p>
</div>
<div class="ui attached segment">
- <p>{{.locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
+ <p>{{ctx.Locale.Tr "auth.authorize_redirect_notice" .ApplicationRedirectDomainHTML | Str2html}}</p>
</div>
<div class="ui attached segment">
<form method="post" action="{{AppSubUrl}}/login/oauth/grant">
@@ -23,7 +23,7 @@
<input type="hidden" name="scope" value="{{.Scope}}">
<input type="hidden" name="nonce" value="{{.Nonce}}">
<input type="hidden" name="redirect_uri" value="{{.RedirectURI}}">
- <button type="submit" id="authorize-app" value="{{.locale.Tr "auth.authorize_application"}}" class="ui red inline button">{{.locale.Tr "auth.authorize_application"}}</button>
+ <button type="submit" id="authorize-app" value="{{ctx.Locale.Tr "auth.authorize_application"}}" class="ui red inline button">{{.locale.Tr "auth.authorize_application"}}</button>
<a href="{{.RedirectURI}}" class="ui basic primary inline button">Cancel</a>
</form>
</div>
diff --git a/templates/user/auth/grant_error.tmpl b/templates/user/auth/grant_error.tmpl
index cfb7e8663b..b2e077960c 100644
--- a/templates/user/auth/grant_error.tmpl
+++ b/templates/user/auth/grant_error.tmpl
@@ -4,11 +4,11 @@
<div class="column seven wide">
<div class="ui middle centered raised segments">
<h1 class="ui top attached header">
- {{.locale.Tr "auth.authorization_failed"}}
+ {{ctx.Locale.Tr "auth.authorization_failed"}}
</h1>
<h3 class="ui attached segment">{{.Error.ErrorDescription}}</h3>
<div class="ui attached segment">
- <p>{{.locale.Tr "auth.authorization_failed_desc"}}</p>
+ <p>{{ctx.Locale.Tr "auth.authorization_failed_desc"}}</p>
</div>
</div>
</div>
diff --git a/templates/user/auth/link_account.tmpl b/templates/user/auth/link_account.tmpl
index 1e059f6814..5235cbf69f 100644
--- a/templates/user/auth/link_account.tmpl
+++ b/templates/user/auth/link_account.tmpl
@@ -6,12 +6,12 @@
{{if not .AllowOnlyInternalRegistration}}
<a class="item {{if not .user_exists}}active{{end}}"
data-tab="auth-link-signup-tab">
- {{.locale.Tr "auth.oauth_signup_tab"}}
+ {{ctx.Locale.Tr "auth.oauth_signup_tab"}}
</a>
{{end}}
<a class="item {{if .user_exists}}active{{end}}"
data-tab="auth-link-signin-tab">
- {{.locale.Tr "auth.oauth_signin_tab"}}
+ {{ctx.Locale.Tr "auth.oauth_signin_tab"}}
</a>
</div>
</div>
diff --git a/templates/user/auth/prohibit_login.tmpl b/templates/user/auth/prohibit_login.tmpl
index ddb16a7f26..668aa20e71 100644
--- a/templates/user/auth/prohibit_login.tmpl
+++ b/templates/user/auth/prohibit_login.tmpl
@@ -4,10 +4,10 @@
<div class="column">
<form class="ui form">
<h2 class="ui top attached header">
- {{.locale.Tr "auth.prohibit_login"}}
+ {{ctx.Locale.Tr "auth.prohibit_login"}}
</h2>
<div class="ui attached segment">
- <p>{{.locale.Tr "auth.prohibit_login_desc"}}</p>
+ <p>{{ctx.Locale.Tr "auth.prohibit_login_desc"}}</p>
</div>
</form>
</div>
diff --git a/templates/user/auth/reset_passwd.tmpl b/templates/user/auth/reset_passwd.tmpl
index d7734bc57f..2f470df441 100644
--- a/templates/user/auth/reset_passwd.tmpl
+++ b/templates/user/auth/reset_passwd.tmpl
@@ -6,44 +6,44 @@
{{.CsrfTokenHtml}}
<input name="code" type="hidden" value="{{.Code}}">
<h2 class="ui top attached header">
- {{.locale.Tr "auth.reset_password"}}
+ {{ctx.Locale.Tr "auth.reset_password"}}
</h2>
<div class="ui attached segment">
{{template "base/alert" .}}
{{if .user_email}}
<div class="inline field">
- <label for="user_name">{{.locale.Tr "email"}}</label>
+ <label for="user_name">{{ctx.Locale.Tr "email"}}</label>
<input id="user_name" type="text" value="{{.user_email}}" disabled>
</div>
{{end}}
{{if .IsResetForm}}
<div class="required inline field {{if .Err_Password}}error{{end}}">
- <label for="password">{{.locale.Tr "settings.new_password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "settings.new_password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" autofocus required>
</div>
{{if not .user_signed_in}}
<div class="inline field">
<label></label>
<div class="ui checkbox">
- <label>{{.locale.Tr "auth.remember_me"}}</label>
+ <label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
{{end}}
{{if .has_two_factor}}
<h4 class="ui dividing header">
- {{.locale.Tr "twofa"}}
+ {{ctx.Locale.Tr "twofa"}}
</h4>
- <div class="ui warning visible message">{{.locale.Tr "settings.twofa_is_enrolled" | Str2html}}</div>
+ <div class="ui warning visible message">{{ctx.Locale.Tr "settings.twofa_is_enrolled" | Str2html}}</div>
{{if .scratch_code}}
<div class="required inline field {{if .Err_Token}}error{{end}}">
- <label for="token">{{.locale.Tr "auth.scratch_code"}}</label>
+ <label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
<input id="token" name="token" type="text" autocomplete="off" autofocus required>
</div>
<input type="hidden" name="scratch_code" value="true">
{{else}}
<div class="required inline field {{if .Err_Passcode}}error{{end}}">
- <label for="passcode">{{.locale.Tr "passcode"}}</label>
+ <label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
<input id="passcode" name="passcode" type="number" autocomplete="off" autofocus required>
</div>
{{end}}
@@ -51,13 +51,13 @@
<div class="divider"></div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.reset_password_helper"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.reset_password_helper"}}</button>
{{if and .has_two_factor (not .scratch_code)}}
- <a href="{{.Link}}?code={{.Code}}&amp;scratch_code=true">{{.locale.Tr "auth.use_scratch_code" | Str2html}}</a>
+ <a href="{{.Link}}?code={{.Code}}&amp;scratch_code=true">{{ctx.Locale.Tr "auth.use_scratch_code" | Str2html}}</a>
{{end}}
</div>
{{else}}
- <p class="center">{{.locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl) | Str2html}}</p>
+ <p class="center">{{ctx.Locale.Tr "auth.invalid_code_forgot_password" (printf "%s/user/forgot_password" AppSubUrl) | Str2html}}</p>
{{end}}
</div>
</form>
diff --git a/templates/user/auth/signin_inner.tmpl b/templates/user/auth/signin_inner.tmpl
index 2b72f119cb..f38b0a2608 100644
--- a/templates/user/auth/signin_inner.tmpl
+++ b/templates/user/auth/signin_inner.tmpl
@@ -3,21 +3,21 @@
{{end}}
<h4 class="ui top attached header center">
{{if .LinkAccountMode}}
- {{.locale.Tr "auth.oauth_signin_title"}}
+ {{ctx.Locale.Tr "auth.oauth_signin_title"}}
{{else}}
- {{.locale.Tr "auth.login_userpass"}}
+ {{ctx.Locale.Tr "auth.login_userpass"}}
{{end}}
</h4>
<div class="ui attached segment">
<form class="ui form" action="{{.SignInLink}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
- <label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+ <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>
</div>
{{if or (not .DisablePassword) .LinkAccountMode}}
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeSignIn))}}error{{end}}">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="current-password" required>
</div>
{{end}}
@@ -25,7 +25,7 @@
<div class="inline field">
<label></label>
<div class="ui checkbox">
- <label>{{.locale.Tr "auth.remember_me"}}</label>
+ <label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
@@ -37,24 +37,24 @@
<label></label>
<button class="ui primary button">
{{if .LinkAccountMode}}
- {{.locale.Tr "auth.oauth_signin_submit"}}
+ {{ctx.Locale.Tr "auth.oauth_signin_submit"}}
{{else}}
- {{.locale.Tr "sign_in"}}
+ {{ctx.Locale.Tr "sign_in"}}
{{end}}
</button>
- <a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a>
+ <a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
</div>
{{if .ShowRegistrationButton}}
<div class="inline field">
<label></label>
- <a href="{{AppSubUrl}}/user/sign_up">{{.locale.Tr "auth.sign_up_now" | Str2html}}</a>
+ <a href="{{AppSubUrl}}/user/sign_up">{{ctx.Locale.Tr "auth.sign_up_now" | Str2html}}</a>
</div>
{{end}}
{{if and .OrderedOAuth2Names .OAuth2Providers}}
<div class="divider divider-text">
- {{.locale.Tr "sign_in_or"}}
+ {{ctx.Locale.Tr "sign_in_or"}}
</div>
<div id="oauth2-login-navigator" class="gt-py-2">
<div class="gt-df gt-fc gt-jc">
@@ -63,7 +63,7 @@
{{$provider := index $.OAuth2Providers $key}}
<a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
{{$provider.IconHTML 28}}
- {{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
+ {{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
</a>
{{end}}
</div>
diff --git a/templates/user/auth/signin_navbar.tmpl b/templates/user/auth/signin_navbar.tmpl
index 84574aa2c2..bc7fd03e13 100644
--- a/templates/user/auth/signin_navbar.tmpl
+++ b/templates/user/auth/signin_navbar.tmpl
@@ -2,10 +2,10 @@
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
<div class="new-menu-inner">
<a class="{{if .PageIsLogin}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login">
- {{.locale.Tr "auth.login_userpass"}}
+ {{ctx.Locale.Tr "auth.login_userpass"}}
</a>
<a class="{{if .PageIsSignUp}}active{{end}} item" rel="nofollow" href="{{AppSubUrl}}/user/sign_up">
- {{.locale.Tr "auth.create_new_account"}}
+ {{ctx.Locale.Tr "auth.create_new_account"}}
</a>
{{if .EnableOpenIDSignIn}}
<a class="{{if .PageIsLoginOpenID}}active {{end}}item" rel="nofollow" href="{{AppSubUrl}}/user/login/openid">
diff --git a/templates/user/auth/signin_openid.tmpl b/templates/user/auth/signin_openid.tmpl
index e1017dca28..0428026aa8 100644
--- a/templates/user/auth/signin_openid.tmpl
+++ b/templates/user/auth/signin_openid.tmpl
@@ -11,7 +11,7 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="inline field">
- {{.locale.Tr "auth.openid_signin_desc"}}
+ {{ctx.Locale.Tr "auth.openid_signin_desc"}}
</div>
<div class="required inline field {{if .Err_OpenID}}error{{end}}">
<label for="openid">
@@ -23,13 +23,13 @@
<div class="inline field">
<label></label>
<div class="ui checkbox">
- <label>{{.locale.Tr "auth.remember_me"}}</label>
+ <label>{{ctx.Locale.Tr "auth.remember_me"}}</label>
<input name="remember" type="checkbox">
</div>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "sign_in"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "sign_in"}}</button>
</div>
</form>
</div>
diff --git a/templates/user/auth/signup_inner.tmpl b/templates/user/auth/signup_inner.tmpl
index e3dd337837..068ccbc618 100644
--- a/templates/user/auth/signup_inner.tmpl
+++ b/templates/user/auth/signup_inner.tmpl
@@ -1,9 +1,9 @@
<div class="ui container column fluid{{if .LinkAccountMode}} icon{{end}}">
<h4 class="ui top attached header center">
{{if .LinkAccountMode}}
- {{.locale.Tr "auth.oauth_signup_title"}}
+ {{ctx.Locale.Tr "auth.oauth_signup_title"}}
{{else}}
- {{.locale.Tr "sign_up"}}
+ {{ctx.Locale.Tr "sign_up"}}
{{end}}
</h4>
<div class="ui attached segment">
@@ -13,24 +13,24 @@
{{template "base/alert" .}}
{{end}}
{{if .DisableRegistration}}
- <p>{{.locale.Tr "auth.disable_register_prompt"}}</p>
+ <p>{{ctx.Locale.Tr "auth.disable_register_prompt"}}</p>
{{else}}
<div class="required inline field {{if and (.Err_UserName) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
- <label for="user_name">{{.locale.Tr "username"}}</label>
+ <label for="user_name">{{ctx.Locale.Tr "username"}}</label>
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Email}}error{{end}}">
- <label for="email">{{.locale.Tr "email"}}</label>
+ <label for="email">{{ctx.Locale.Tr "email"}}</label>
<input id="email" name="email" type="email" value="{{.email}}" required>
</div>
{{if not .DisablePassword}}
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="new-password" required>
</div>
<div class="required inline field {{if and (.Err_Password) (or (not .LinkAccountMode) (and .LinkAccountMode .LinkAccountModeRegister))}}error{{end}}">
- <label for="retype">{{.locale.Tr "re_type"}}</label>
+ <label for="retype">{{ctx.Locale.Tr "re_type"}}</label>
<input id="retype" name="retype" type="password" value="{{.retype}}" autocomplete="new-password" required>
</div>
{{end}}
@@ -41,9 +41,9 @@
<label></label>
<button class="ui primary button">
{{if .LinkAccountMode}}
- {{.locale.Tr "auth.oauth_signup_submit"}}
+ {{ctx.Locale.Tr "auth.oauth_signup_submit"}}
{{else}}
- {{.locale.Tr "auth.create_new_account"}}
+ {{ctx.Locale.Tr "auth.create_new_account"}}
{{end}}
</button>
</div>
@@ -51,14 +51,14 @@
{{if not .LinkAccountMode}}
<div class="inline field">
<label></label>
- <a href="{{AppSubUrl}}/user/login">{{.locale.Tr "auth.register_helper_msg"}}</a>
+ <a href="{{AppSubUrl}}/user/login">{{ctx.Locale.Tr "auth.register_helper_msg"}}</a>
</div>
{{end}}
{{end}}
{{if and .OrderedOAuth2Names .OAuth2Providers}}
<div class="divider divider-text">
- {{.locale.Tr "sign_in_or"}}
+ {{ctx.Locale.Tr "sign_in_or"}}
</div>
<div id="oauth2-login-navigator" class="gt-py-2">
<div class="gt-df gt-fc gt-jc">
@@ -67,7 +67,7 @@
{{$provider := index $.OAuth2Providers $key}}
<a class="{{$provider.Name}} ui button gt-df gt-ac gt-jc gt-py-3 oauth-login-link" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
{{$provider.IconHTML 28}}
- {{$.locale.Tr "sign_in_with_provider" $provider.DisplayName}}
+ {{ctx.Locale.Tr "sign_in_with_provider" $provider.DisplayName}}
</a>
{{end}}
</div>
diff --git a/templates/user/auth/signup_openid_connect.tmpl b/templates/user/auth/signup_openid_connect.tmpl
index 1a470415c6..e4b7936374 100644
--- a/templates/user/auth/signup_openid_connect.tmpl
+++ b/templates/user/auth/signup_openid_connect.tmpl
@@ -4,20 +4,20 @@
<div class="ui container">
{{template "base/alert" .}}
<h4 class="ui top attached header">
- {{.locale.Tr "auth.openid_connect_title"}}
+ {{ctx.Locale.Tr "auth.openid_connect_title"}}
</h4>
<div class="ui attached segment">
<p>
- {{.locale.Tr "auth.openid_connect_desc"}}
+ {{ctx.Locale.Tr "auth.openid_connect_desc"}}
</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
- <label for="user_name">{{.locale.Tr "home.uname_holder"}}</label>
+ <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>
</div>
<div class="required inline field {{if .Err_Password}}error{{end}}">
- <label for="password">{{.locale.Tr "password"}}</label>
+ <label for="password">{{ctx.Locale.Tr "password"}}</label>
<input id="password" name="password" type="password" value="{{.password}}" autocomplete="off" required>
</div>
<div class="inline field">
@@ -26,8 +26,8 @@
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.openid_connect_submit"}}</button>
- <a href="{{AppSubUrl}}/user/forgot_password">{{.locale.Tr "auth.forgot_password"}}</a>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.openid_connect_submit"}}</button>
+ <a href="{{AppSubUrl}}/user/forgot_password">{{ctx.Locale.Tr "auth.forgot_password"}}</a>
</div>
</form>
</div>
diff --git a/templates/user/auth/signup_openid_navbar.tmpl b/templates/user/auth/signup_openid_navbar.tmpl
index f52c3ed6a0..075f2e4d7b 100644
--- a/templates/user/auth/signup_openid_navbar.tmpl
+++ b/templates/user/auth/signup_openid_navbar.tmpl
@@ -1,11 +1,11 @@
<div class="ui secondary pointing tabular top attached borderless menu new-menu navbar">
<div class="new-menu-inner">
<a class="{{if .PageIsOpenIDConnect}}active {{end}}item" href="{{AppSubUrl}}/user/openid/connect">
- {{.locale.Tr "auth.openid_connect_title"}}
+ {{ctx.Locale.Tr "auth.openid_connect_title"}}
</a>
{{if and .EnableOpenIDSignUp (not .AllowOnlyInternalRegistration)}}
<a class="{{if .PageIsOpenIDRegister}}active {{end}}item" href="{{AppSubUrl}}/user/openid/register">
- {{.locale.Tr "auth.openid_register_title"}}
+ {{ctx.Locale.Tr "auth.openid_register_title"}}
</a>
{{end}}
</div>
diff --git a/templates/user/auth/signup_openid_register.tmpl b/templates/user/auth/signup_openid_register.tmpl
index 9736c53ed8..81c36957d1 100644
--- a/templates/user/auth/signup_openid_register.tmpl
+++ b/templates/user/auth/signup_openid_register.tmpl
@@ -4,20 +4,20 @@
<div class="ui container">
{{template "base/alert" .}}
<h4 class="ui top attached header">
- {{.locale.Tr "auth.openid_register_title"}}
+ {{ctx.Locale.Tr "auth.openid_register_title"}}
</h4>
<div class="ui attached segment">
<p>
- {{.locale.Tr "auth.openid_register_desc"}}
+ {{ctx.Locale.Tr "auth.openid_register_desc"}}
</p>
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<div class="required inline field {{if .Err_UserName}}error{{end}}">
- <label for="user_name">{{.locale.Tr "username"}}</label>
+ <label for="user_name">{{ctx.Locale.Tr "username"}}</label>
<input id="user_name" type="text" name="user_name" value="{{.user_name}}" autofocus required>
</div>
<div class="required inline field {{if .Err_Email}}error{{end}}">
- <label for="email">{{.locale.Tr "email"}}</label>
+ <label for="email">{{ctx.Locale.Tr "email"}}</label>
<input id="email" name="email" type="email" value="{{.email}}" required>
</div>
@@ -29,7 +29,7 @@
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.create_new_account"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.create_new_account"}}</button>
</div>
</form>
</div>
diff --git a/templates/user/auth/twofa.tmpl b/templates/user/auth/twofa.tmpl
index e303580956..d325114155 100644
--- a/templates/user/auth/twofa.tmpl
+++ b/templates/user/auth/twofa.tmpl
@@ -5,19 +5,19 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
- {{.locale.Tr "twofa"}}
+ {{ctx.Locale.Tr "twofa"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<div class="required inline field">
- <label for="passcode">{{.locale.Tr "passcode"}}</label>
+ <label for="passcode">{{ctx.Locale.Tr "passcode"}}</label>
<input id="passcode" name="passcode" type="text" autocomplete="one-time-code" inputmode="numeric" pattern="[0-9]*" autofocus required>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
- <a href="{{AppSubUrl}}/user/two_factor/scratch">{{.locale.Tr "auth.use_scratch_code" | Str2html}}</a>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
+ <a href="{{AppSubUrl}}/user/two_factor/scratch">{{ctx.Locale.Tr "auth.use_scratch_code" | Str2html}}</a>
</div>
</div>
</form>
diff --git a/templates/user/auth/twofa_scratch.tmpl b/templates/user/auth/twofa_scratch.tmpl
index 58942050f5..1aa044b4a5 100644
--- a/templates/user/auth/twofa_scratch.tmpl
+++ b/templates/user/auth/twofa_scratch.tmpl
@@ -5,18 +5,18 @@
<form class="ui form" action="{{.Link}}" method="post">
{{.CsrfTokenHtml}}
<h3 class="ui top attached header">
- {{.locale.Tr "twofa_scratch"}}
+ {{ctx.Locale.Tr "twofa_scratch"}}
</h3>
<div class="ui attached segment">
{{template "base/alert" .}}
<div class="required inline field">
- <label for="token">{{.locale.Tr "auth.scratch_code"}}</label>
+ <label for="token">{{ctx.Locale.Tr "auth.scratch_code"}}</label>
<input id="token" name="token" type="text" autocomplete="off" autofocus required>
</div>
<div class="inline field">
<label></label>
- <button class="ui primary button">{{.locale.Tr "auth.verify"}}</button>
+ <button class="ui primary button">{{ctx.Locale.Tr "auth.verify"}}</button>
</div>
</div>
</form>
diff --git a/templates/user/auth/webauthn.tmpl b/templates/user/auth/webauthn.tmpl
index c689f9c6d4..f738937025 100644
--- a/templates/user/auth/webauthn.tmpl
+++ b/templates/user/auth/webauthn.tmpl
@@ -3,19 +3,19 @@
<div class="ui page grid">
<div class="column center aligned">
{{template "user/auth/webauthn_error" .}}
- <h3 class="ui top attached header">{{.locale.Tr "twofa"}}</h3>
+ <h3 class="ui top attached header">{{ctx.Locale.Tr "twofa"}}</h3>
<div class="ui attached segment">
{{svg "octicon-key" 56}}
- <h3>{{.locale.Tr "webauthn_insert_key"}}</h3>
+ <h3>{{ctx.Locale.Tr "webauthn_insert_key"}}</h3>
{{template "base/alert" .}}
- <p>{{.locale.Tr "webauthn_sign_in"}}</p>
+ <p>{{ctx.Locale.Tr "webauthn_sign_in"}}</p>
</div>
<div class="ui attached segment gt-df gt-ac gt-jc gt-gap-2 gt-py-3">
<div class="is-loading" style="width: 40px; height: 40px"></div>
- {{.locale.Tr "webauthn_press_button"}}
+ {{ctx.Locale.Tr "webauthn_press_button"}}
</div>
<div class="ui attached segment">
- <a href="{{AppSubUrl}}/user/two_factor">{{.locale.Tr "webauthn_use_twofa"}}</a>
+ <a href="{{AppSubUrl}}/user/two_factor">{{ctx.Locale.Tr "webauthn_use_twofa"}}</a>
</div>
</div>
</div>
diff --git a/templates/user/auth/webauthn_error.tmpl b/templates/user/auth/webauthn_error.tmpl
index 59029bbf91..fc6064db76 100644
--- a/templates/user/auth/webauthn_error.tmpl
+++ b/templates/user/auth/webauthn_error.tmpl
@@ -1,13 +1,13 @@
<div id="webauthn-error" class="ui negative message gt-hidden">
- <div class="header">{{.locale.Tr "webauthn_error"}}</div>
+ <div class="header">{{ctx.Locale.Tr "webauthn_error"}}</div>
<div id="webauthn-error-msg" class="gt-pt-3"></div>
<div class="gt-hidden">
- <div data-webauthn-error-msg="browser">{{.locale.Tr "webauthn_unsupported_browser"}}</div>
- <div data-webauthn-error-msg="unknown">{{.locale.Tr "webauthn_error_unknown"}}</div>
- <div data-webauthn-error-msg="insecure">{{.locale.Tr "webauthn_error_insecure"}}</div>
- <div data-webauthn-error-msg="unable-to-process">{{.locale.Tr "webauthn_error_unable_to_process"}}</div>
- <div data-webauthn-error-msg="duplicated">{{.locale.Tr "webauthn_error_duplicated"}}</div>
- <div data-webauthn-error-msg="empty">{{.locale.Tr "webauthn_error_empty"}}</div>
- <div data-webauthn-error-msg="timeout">{{.locale.Tr "webauthn_error_timeout"}}</div>
+ <div data-webauthn-error-msg="browser">{{ctx.Locale.Tr "webauthn_unsupported_browser"}}</div>
+ <div data-webauthn-error-msg="unknown">{{ctx.Locale.Tr "webauthn_error_unknown"}}</div>
+ <div data-webauthn-error-msg="insecure">{{ctx.Locale.Tr "webauthn_error_insecure"}}</div>
+ <div data-webauthn-error-msg="unable-to-process">{{ctx.Locale.Tr "webauthn_error_unable_to_process"}}</div>
+ <div data-webauthn-error-msg="duplicated">{{ctx.Locale.Tr "webauthn_error_duplicated"}}</div>
+ <div data-webauthn-error-msg="empty">{{ctx.Locale.Tr "webauthn_error_empty"}}</div>
+ <div data-webauthn-error-msg="timeout">{{ctx.Locale.Tr "webauthn_error_timeout"}}</div>
</div>
</div>