Translation fixes
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
<div class="p-3">
|
||||
<div class="text-primary font-weight-bold">{{ .Name }}</div>
|
||||
<div>
|
||||
{{ tr "authorized-clients.template.authorized" }}
|
||||
{{ tr "authorized-clients.template.list.authorized-on" }}
|
||||
<time
|
||||
datetime="{{ .ConfirmedAt | date "2006-01-02T15:04:05Z07:00" }}"
|
||||
>
|
||||
@@ -27,12 +27,12 @@
|
||||
value="{{ .ID }}"
|
||||
class="btn btn-sm btn-danger"
|
||||
>
|
||||
{{ tr "authorized-clients.template.button.revoke-access" }}
|
||||
{{ tr "authorized-clients.template.list.buttons.revoke" }}
|
||||
</button>
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="text-center m-3 mb-5">
|
||||
<i>{{ tr "authorized-clients.template.no-auth-clients" }}</i>
|
||||
<i>{{ tr "authorized-clients.template.list.empty" }}</i>
|
||||
</div>
|
||||
{{ end }}
|
||||
</form>
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
</div>
|
||||
{{ else }}
|
||||
<div class="text-dark font-weight-bold" role="primary">
|
||||
{{ tr "logout.log-out" }}
|
||||
{{ tr "logout.template.log-out" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<div class="text-center my-3">
|
||||
Click here to <a href="{{ if .backlink }}{{ .backlink }}{{ else }}{{ links.Login }}{{ end }}">Log in</a>
|
||||
{{ tr "logout.template.log-in" "link" .link }}
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{{ template "inc_header.html.tpl" set . "hideNav" true }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "mfa_totp_disable.template.title" }}</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "mfa-totp-disable.template.title" }}</h1>
|
||||
|
||||
<form
|
||||
class="p-3"
|
||||
method="POST"
|
||||
action="{{ links.MfaTotpDisable }}"
|
||||
>
|
||||
{{ tr "mfa_totp_disable.template.form.title" }}
|
||||
{{ tr "mfa-totp-disable.template.instructions" }}
|
||||
|
||||
{{ if .form.error }}
|
||||
<div class="pt-3 text-danger font-weight-bold" role="alert">
|
||||
@@ -37,7 +37,7 @@
|
||||
value="true"
|
||||
type="submit"
|
||||
>
|
||||
{{ tr "mfa_totp_disable.template.form.button" }}
|
||||
{{ tr "mfa-totp-disable.template.button.remove" }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{{ template "inc_header.html.tpl" set . "hideNav" true }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">Configure two-factor authentication with TOTP</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "mfa-totp.template.title" }}</h1>
|
||||
|
||||
{{ if .enforced }}
|
||||
<p class="p-3 text-danger mb-0 font-weight-bold">
|
||||
{{ tr "mfa_totp.template.paragraph" }}
|
||||
{{ tr "mfa-totp.template.enforced" }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
method="POST"
|
||||
action="{{ links.MfaTotpNewSecret }}"
|
||||
>
|
||||
{{ tr "mfa_totp.template.form.title-2" }}
|
||||
{{ tr "mfa-totp.template.form.title" }}
|
||||
|
||||
{{ if .form.error }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@@ -50,38 +50,27 @@
|
||||
value="true"
|
||||
type="submit"
|
||||
>
|
||||
{{ tr "mfa_totp.template.form.button" }}
|
||||
{{ tr "mfa-totp.template.form.button" }}
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-12 col-sm-6">
|
||||
<p class="text-justify">
|
||||
{{ tr "mfa_totp.template.form.paragraph-one" }}
|
||||
</p>
|
||||
<p>
|
||||
{{ tr "mfa_totp.template.form.paragraph-two" }}
|
||||
</p>
|
||||
<p>
|
||||
{{ tr "mfa_totp.template.form.paragraph-three" }}
|
||||
{{ tr "mfa-totp.template.instructions" }}
|
||||
</p>
|
||||
<ul>
|
||||
<li>
|
||||
<a target="_blank" href="https://lastpass.com/auth/">{{ tr "mfa_totp.template.form.ul-links.auth" }}</a>
|
||||
{{ tr "mfa-totp.template.lastpass" "lastpass" "https://lastpass.com/auth/" }}
|
||||
</li>
|
||||
<li>
|
||||
{{ tr "mfa_totp.template.form.ul-links.text" }} <br />
|
||||
<a target="_blank" href="https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2">{{ tr "mfa_totp.template.form.ul-links.android" }}</a>
|
||||
{{ tr "mfa_totp.template.form.ul-links.or" }}
|
||||
<a target="_blank" href="https://apps.apple.com/us/app/google-authenticator/id388497605">{{ tr "mfa_totp.template.form.ul-links.store" }}</a>
|
||||
{{ tr "mfa-totp.template.gauth" "android" "https://play.google.com/store/apps/details?id=com.google.android.apps.authenticator2" "iphone" "https://apps.apple.com/us/app/google-authenticator/id388497605" }}
|
||||
</li>
|
||||
<li>
|
||||
<a target="_blank" href="https://authy.com">{{ tr "mfa_totp.template.form.ul-links.authy" }}</a>
|
||||
{{ tr "mfa-totp.template.authy" "link" "https://authy.com" }}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
{{ template "inc_footer.html.tpl" . }}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
method="POST"
|
||||
action="{{ links.Mfa }}"
|
||||
>
|
||||
<h5>{{ tr "mfa.template.form-1.title" }}</h5>
|
||||
<h5>{{ tr "mfa.template.email.instructions" }}</h5>
|
||||
|
||||
{{ if .form.emailOtpError }}
|
||||
<div class="text-danger my-4 font-weight-bold" role="alert">
|
||||
@@ -27,10 +27,10 @@
|
||||
maxlength="6"
|
||||
minlength="6"
|
||||
aria-required="true"
|
||||
placeholder="{{ tr "mfa.template.input-group-my-3.placeholder" }}"
|
||||
placeholder="000 000"
|
||||
autocomplete="off"
|
||||
style="letter-spacing:5px;font-size:20px;"
|
||||
aria-label="{{ tr "mfa.template.input-group-my-3.aria-label" }}">
|
||||
aria-label="{{ tr "mfa.template.email.code" }}">
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -39,7 +39,7 @@
|
||||
value="verifyEmailOtp"
|
||||
type="submit"
|
||||
>
|
||||
{{ tr "mfa.buttons.verify" }}
|
||||
{{ tr "mfa.template.email.verify" }}
|
||||
</button>
|
||||
|
||||
<a
|
||||
@@ -48,12 +48,12 @@
|
||||
name="action"
|
||||
value="resendEmailOtp"
|
||||
>
|
||||
{{ tr "mfa.buttons.resend" }}
|
||||
{{ tr "mfa.template.email.resend" }}
|
||||
</a>
|
||||
</form>
|
||||
{{ else if not .emailOtpDisabled }}
|
||||
<p class="p-3 mb-0">
|
||||
<i class="bi bi-check-circle text-success h5 mr-1"></i> {{ tr "mfa.paragraph-1" }}
|
||||
<i class="bi bi-check-circle text-success h5 mr-1"></i> {{ tr "mfa.template.email.confirmed" }}
|
||||
</p>
|
||||
{{ end }}
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
method="POST"
|
||||
action="{{ links.Mfa }}"
|
||||
>
|
||||
<h5>{{ tr "mfa.template.form-2.title" }}</h5>
|
||||
<h5>{{ tr "mfa.template.totp.instructions" }}</h5>
|
||||
|
||||
{{ if .form.totpError }}
|
||||
<div class="alert alert-danger" role="alert">
|
||||
@@ -82,10 +82,10 @@
|
||||
maxlength="6"
|
||||
minlength="6"
|
||||
aria-required="true"
|
||||
placeholder="{{ tr "mfa.template.input-group-my-3.placeholder" }}"
|
||||
placeholder="000 000"
|
||||
autocomplete="off"
|
||||
style="letter-spacing:5px;font-size:20px;"
|
||||
aria-label="{{ tr "mfa.template.input-group-my-3.aria-label" }}">
|
||||
aria-label="{{ tr "mfa.template.totp.code" }}">
|
||||
</div>
|
||||
|
||||
<button
|
||||
@@ -94,12 +94,12 @@
|
||||
name="action"
|
||||
value="verifyTotp"
|
||||
>
|
||||
{{ tr "mfa.buttons.verify" }}
|
||||
{{ tr "mfa.template.email.verify" }}
|
||||
</button>
|
||||
</form>
|
||||
{{ else if not .totpDisabled }}
|
||||
<p class="p-3 mb-0">
|
||||
<i class="bi bi-check-circle text-success h5 mr-1"></i> {{ tr "mfa.paragraph-2" }}
|
||||
<i class="bi bi-check-circle text-success h5 mr-1"></i> {{ tr "mfa.template.totp.confirmed" }}
|
||||
</p>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
@@ -3,11 +3,11 @@
|
||||
<div class="card-body p-0">
|
||||
{{ if .invalidUser }}
|
||||
<div class="text-danger font-weight-bold p-3" role="alert">
|
||||
{{ .invalidUser }}
|
||||
{{ tr "oauth2-authorize-client.template.errors.invalid-user" "link" links.Profile }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "oauth2_authorize_client.template.title" }} "{{ coalesce .client.Name }}"</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "oauth2-authorize-client.template.title" }} "{{ coalesce .client.Name }}"</h1>
|
||||
|
||||
<form
|
||||
action="{{ links.OAuth2AuthorizeClient }}"
|
||||
@@ -16,10 +16,10 @@
|
||||
>
|
||||
{{ .csrfField }}
|
||||
<p>
|
||||
{{ tr "oauth2_authorize_client.template.form.greeting-paragraph" }} {{ coalesce .user.Name .user.Handle .user.Email }},
|
||||
{{ tr "oauth2-authorize-client.template.form.greeting-paragraph" }} {{ coalesce .user.Name .user.Handle .user.Email }},
|
||||
</p>
|
||||
<p>
|
||||
<b>{{ .client.Name }}</b> {{ tr "oauth2_authorize_client.template.form.question-for-client" }}
|
||||
<b>{{ .client.Name }}</b> {{ tr "oauth2-authorize-client.template.form.question-for-client" }}
|
||||
</p>
|
||||
|
||||
<p class="text-center">
|
||||
@@ -30,7 +30,7 @@
|
||||
class="btn btn-{{ if .disabled }}secondary{{ else }}primary{{ end }} btn-lg m-2"
|
||||
style="width:250px;"
|
||||
>
|
||||
{{ tr "oauth2_authorize_client.template.form.button-allow" }}
|
||||
{{ tr "oauth2-authorize-client.template.form.buttons.allow" }}
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
@@ -38,11 +38,11 @@
|
||||
class="btn btn-danger btn-lg m-2"
|
||||
style="width:250px;"
|
||||
>
|
||||
{{ tr "oauth2_authorize_client.template.form.button-deny" }}
|
||||
{{ tr "oauth2-authorize-client.template.form.buttons.deny" }}
|
||||
</button>
|
||||
</p>
|
||||
<div class="text-center">
|
||||
{{ tr "oauth2_authorize_client.template.form.mistake" }} <a href="{{ links.Logout }}">{{ tr "oauth2_authorize_client.template.form.log-out-link" }}</a>.
|
||||
{{ tr "oauth2-authorize-client.template.links.mistake" }}
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
{{ template "inc_header.html.tpl" . }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "password_reset_requested.template.title" }}</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "password-reset-requested.template.title" }}</h1>
|
||||
<div class="p-3" role="alert">
|
||||
{{ tr "password_reset_requested.template.alert" }}
|
||||
{{ tr "password-reset-requested.template.instructions" }}
|
||||
</div>
|
||||
<div class="text-center my-3">
|
||||
<a href="{{ links.Signup }}">{{ tr "password_reset_requested.template.new-account-link" }}</a>
|
||||
or
|
||||
<a href="{{ links.Login }}">{{ tr "password_reset_requested.template.login" }}</a>
|
||||
{{ tr "password-reset-requested.template.links" "signup" links.Signup "login" links.Login }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ template "inc_footer.html.tpl" . }}
|
||||
|
||||
@@ -1,13 +1,11 @@
|
||||
{{ template "inc_header.html.tpl" . }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "pending_email_confirmation.template.title" }}</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "pending-email-confirmation.template.title" }}</h1>
|
||||
<div class="p-3" role="alert">
|
||||
{{ tr "pending_email_confirmation.template.alert" }}
|
||||
{{ tr "pending-email-confirmation.template.instructions" }}
|
||||
</div>
|
||||
<div class="text-center my-3">
|
||||
<a href="{{ links.Signup }}">{{ tr "pending_email_confirmation.template.new-acc-link" }}</a>
|
||||
or
|
||||
<a href="{{ links.Login }}">{{ tr "pending_email_confirmation.template.login" }}</a>
|
||||
{{ tr "pending-email-confirmation.template.links" "signup" links.Signup "login" links.Login }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ template "inc_footer.html.tpl" . }}
|
||||
|
||||
@@ -21,15 +21,15 @@
|
||||
class="form-control"
|
||||
name="email"
|
||||
id="profileFormEmail"
|
||||
placeholder="{{ tr "profile.template.form.email.placeholder" }}"
|
||||
placeholder="email@domain.ltd"
|
||||
autocomplete="username"
|
||||
readonly
|
||||
value="{{ .form.email }}"
|
||||
aria-label="{{ tr "profile.template.form.email.aria-label" }}">
|
||||
aria-label="{{ tr "profile.template.form.email.label" }}">
|
||||
<div>
|
||||
{{ if .emailConfirmationRequired }}
|
||||
<div class="form-text text-danger">
|
||||
{{ tr "profile.template.form.text-danger-1" }} <a href="{{ links.PendingEmailConfirmation }}?resend">{{ tr "profile.template.form.text-danger-2" }}</a>
|
||||
{{ tr "profile.template.form.email.resend-confirmation-link" "link" links.PendingEmailConfirmation }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
@@ -45,7 +45,7 @@
|
||||
placeholder="{{ tr "profile.template.form.name.placeholder" }}"
|
||||
value="{{ .form.name }}"
|
||||
autocomplete="name"
|
||||
aria-label="{{ tr "profile.template.form.name.aria-label" }}">
|
||||
aria-label="{{ tr "profile.template.form.name.label" }}">
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
@@ -58,7 +58,7 @@
|
||||
placeholder="{{ tr "profile.template.form.handle.placeholder" }}"
|
||||
value="{{ .form.handle }}"
|
||||
autocomplete="handle"
|
||||
aria-label="{{ tr "profile.template.form.handle.aria-label" }}">
|
||||
aria-label="{{ tr "profile.template.form.handle.label" }}">
|
||||
</div>
|
||||
|
||||
<div>
|
||||
@@ -66,7 +66,7 @@
|
||||
type="submit"
|
||||
class="btn btn-primary btn-block btn-lg"
|
||||
>
|
||||
{{ tr "profile.template.form.button" }}
|
||||
{{ tr "profile.template.form.buttons.submit" }}
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ template "inc_header.html.tpl" . }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "request_password_reset.template.title" }}</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "request-password-reset.template.title" }}</h1>
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ links.RequestPasswordReset }}"
|
||||
@@ -14,26 +14,24 @@
|
||||
{{ end }}
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
{{ tr "request_password_reset.template.form.email.label" }}
|
||||
{{ tr "request-password-reset.template.form.email.label" }}
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
name="email"
|
||||
required
|
||||
placeholder="{{ tr "request_password_reset.template.form.email.placeholder" }}"
|
||||
placeholder="{{ tr "request-password-reset.template.form.email.placeholder" }}"
|
||||
autocomplete="username"
|
||||
value="{{ if .form }}{{ .form.email }}{{ end }}"
|
||||
aria-label="{{ tr "request_password_reset.template.form.email.aria-label" }}">
|
||||
aria-label="{{ tr "request-password-reset.template.form.email.label" }}">
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-primary btn-block btn-lg" type="submit">{{ tr "request_password_reset.template.form.button" }}</button>
|
||||
<button class="btn btn-primary btn-block btn-lg" type="submit">{{ tr "request-password-reset.template.form.buttons.request" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="text-center my-3">
|
||||
<a href="{{ links.Signup }}">{{ tr "request_password_reset.template.new-acc-link" }}</a>
|
||||
{{ tr "request_password_reset.template.or" }}
|
||||
<a href="{{ links.Login }}">{{ tr "request_password_reset.template.login" }}</a>
|
||||
{{ tr "request-password-reset.template.links" "signup" links.Signup "login" links.Login }}</a>
|
||||
</div>
|
||||
</div>
|
||||
{{ template "inc_footer.html.tpl" . }}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{{ template "inc_header.html.tpl" . }}
|
||||
<div class="card-body p-0">
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "reset_password.template.title" }}</h1>
|
||||
<h1 class="h4 card-title p-3 border-bottom">{{ tr "reset-password.template.title" }}</h1>
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ links.ResetPassword }}"
|
||||
@@ -14,20 +14,20 @@
|
||||
{{ end }}
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
{{ tr "reset_password.template.form.email.label" }}
|
||||
{{ tr "reset-password.template.form.email.label" }}
|
||||
</label>
|
||||
<input
|
||||
type="email"
|
||||
class="form-control"
|
||||
name="email"
|
||||
readonly
|
||||
placeholder="{{ tr "reset_password.template.form.email.placeholder" }}"
|
||||
placeholder="{{ tr "reset-password.template.form.email.placeholder" }}"
|
||||
value="{{ .user.Email }}"
|
||||
aria-label="{{ tr "reset_password.template.form.email.aria-label" }}">
|
||||
aria-label="{{ tr "reset-password.template.form.emaillabel" }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
{{ tr "reset_password.template.form.new-password.label" }}
|
||||
{{ tr "reset-password.template.form.new-password.label" }}
|
||||
</label>
|
||||
<input
|
||||
type="password"
|
||||
@@ -35,11 +35,11 @@
|
||||
class="form-control"
|
||||
name="password"
|
||||
autocomplete="new-password"
|
||||
placeholder="{{ tr "reset_password.template.form.new-password.placeholder" }}"
|
||||
aria-label="{{ tr "reset_password.template.form.new-password.aria-label" }}">
|
||||
placeholder="{{ tr "reset-password.template.form.new-password.placeholder" }}"
|
||||
aria-label="{{ tr "reset-password.template.form.new-passwordlabel" }}">
|
||||
</div>
|
||||
<div class="text-right">
|
||||
<button class="btn btn-primary btn-block btn-lg" type="submit">{{ tr "reset_password.template.form.button.change-password" }}</button>
|
||||
<button class="btn btn-primary btn-block btn-lg" type="submit">{{ tr "reset-password.template.form.buttons.change-password" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
@@ -110,7 +110,8 @@ mfa-totp-disable:
|
||||
error: "There was an error..."
|
||||
|
||||
logout:
|
||||
Default: {}
|
||||
Default:
|
||||
link: '#'
|
||||
With error:
|
||||
form:
|
||||
error: "There was an error..."
|
||||
|
||||
@@ -8,19 +8,19 @@
|
||||
>
|
||||
|
||||
{{ if .settings.LocalEnabled }}
|
||||
<h5>{{ tr "security.template.form.title" }}</h5>
|
||||
<a href="{{ links.ChangePassword }}">{{ tr "security.template.form.passw-change" }}</a>
|
||||
<h5>{{ tr "security.template.password.title" }}</h5>
|
||||
<a href="{{ links.ChangePassword }}">{{ tr "security.template.password.change-link" }}</a>
|
||||
{{ end }}
|
||||
|
||||
<hr />
|
||||
|
||||
<div>
|
||||
{{ .csrfField }}
|
||||
<h5>{{ tr "security.template.security.title" }}</h5>
|
||||
<h5>{{ tr "security.template.mfa.title" }}</h5>
|
||||
{{ if or .settings.MultiFactor.TOTP.Enabled .settings.MultiFactor.EmailOTP.Enabled }}
|
||||
{{ if .settings.MultiFactor.TOTP.Enabled }}
|
||||
<div class="py-4">
|
||||
<h6>{{ tr "security.template.security.description" }}</h6>
|
||||
<h6>{{ tr "security.template.mfa.totp.title" }}</h6>
|
||||
<div class="row">
|
||||
<div class="col-10 pt-2">
|
||||
{{ if .totpEnforced }}
|
||||
@@ -29,18 +29,18 @@
|
||||
<i class="bi bi-exclamation-circle-fill text-danger h5 mr-1"></i>
|
||||
{{ end }}
|
||||
{{ if .totpEnforced }}
|
||||
{{ tr "security.template.security.req-login" }}
|
||||
{{ tr "security.template.mfa.totp.enforced" }}
|
||||
{{ else }}
|
||||
{{ tr "security.template.security.disable" }}
|
||||
{{ tr "security.template.mfa.totp.disabled" }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-12">
|
||||
{{ if .totpEnforced }}
|
||||
{{ if not .settings.MultiFactor.TOTP.Enforced }}
|
||||
<button name="action" value="disableTOTP" class="btn btn-danger float-right">{{ tr "security.template.button.disable" }}</button>
|
||||
<button name="action" value="disableTOTP" class="btn btn-danger float-right">{{ tr "security.template.mfa.totp.disable" }}</button>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<button name="action" value="configureTOTP" class="btn btn-primary float-right">{{ tr "security.template.button.configure" }}</button>
|
||||
<button name="action" value="configureTOTP" class="btn btn-primary float-right">{{ tr "security.template.mfa.totp.configure" }}</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
{{ if .settings.MultiFactor.EmailOTP.Enabled }}
|
||||
<div class="py-4">
|
||||
<h6>{{ tr "security.template.aditional-security.title" }}</h6>
|
||||
<h6>{{ tr "security.template.mfa.email.title" }}</h6>
|
||||
<div class="row">
|
||||
<div class="col-10 pt-2">
|
||||
{{ if .emailOtpEnforced }}
|
||||
@@ -58,18 +58,18 @@
|
||||
<i class="bi bi-exclamation-circle-fill text-danger h5 mr-1"></i>
|
||||
{{ end }}
|
||||
{{ if .emailOtpEnforced }}
|
||||
{{ tr "security.template.aditional-security.email-otp-enforced" }}
|
||||
{{ tr "security.template.mfa.email.enforced" }}
|
||||
{{ else }}
|
||||
{{ tr "security.template.aditional-security.disable" }}
|
||||
{{ tr "security.template.mfa.email.disabled" }}
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="col-md-2 col-sm-12">
|
||||
{{ if .emailOtpEnforced }}
|
||||
{{ if not .settings.MultiFactor.EmailOTP.Enforced }}
|
||||
<button name="action" value="disableEmailOTP" class="btn btn-danger float-right">{{ tr "security.template.button.disable" }}</button>
|
||||
<button name="action" value="disableEmailOTP" class="btn btn-danger float-right">{{ tr "security.template.mfa.email.disable" }}</button>
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<button name="action" value="enableEmailOTP" class="btn btn-primary float-right">{{ tr "security.template.button.enable" }}</button>
|
||||
<button name="action" value="enableEmailOTP" class="btn btn-primary float-right">{{ tr "security.template.mfa.email.enable" }}</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
{{ end }}
|
||||
{{ else }}
|
||||
<div class="mb-4 font-italic" role="alert">
|
||||
{{ tr "security.template.alert" }}
|
||||
{{ tr "security.template.mfa.all-disabled" }}
|
||||
</div>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
{{ template "inc_header.html.tpl" set . "activeNav" "sessions" }}
|
||||
<div class="card-body p-0">
|
||||
<div class="card-title p-3 border-bottom">
|
||||
<h4 class="card-title d-inline">{{ tr "session.template.title" }}</h4>
|
||||
{{ if .sessions}}
|
||||
<button
|
||||
type="submit"
|
||||
name="delete-all-but-current"
|
||||
value="true"
|
||||
class="btn btn-sm btn-danger float-right"
|
||||
>
|
||||
{{ tr "session.template.button.delete-all" }}
|
||||
</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
<div class="card-title p-3 border-bottom">
|
||||
<h4 class="card-title d-inline">{{ tr "sessions.template.title" }}</h4>
|
||||
{{ if .sessions}}
|
||||
<button
|
||||
type="submit"
|
||||
name="delete-all-but-current"
|
||||
value="true"
|
||||
class="btn btn-sm btn-danger float-right"
|
||||
>
|
||||
{{ tr "sessions.template.delete-all" }}
|
||||
</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ links.Sessions }}"
|
||||
@@ -23,7 +23,7 @@
|
||||
{{ range .sessions}}
|
||||
<div class="mb-3 border-bottom">
|
||||
{{ if .Current }}
|
||||
<h5>{{ tr "session.template.form.title" }}</h5>
|
||||
<h5>{{ tr "sessions.template.list.current" }}</h5>
|
||||
{{ end }}
|
||||
{{ if not .Current }}
|
||||
<button
|
||||
@@ -32,37 +32,37 @@
|
||||
value="{{ .ID }}"
|
||||
class="btn btn-sm btn-link text-danger float-right"
|
||||
>
|
||||
{{ tr "session.template.button.delete-this" }}
|
||||
{{ tr "sessions.template.list.delete" }}
|
||||
</button>
|
||||
{{ end }}
|
||||
<label class="mb-0 d-block">{{ tr "session.template.form.label-auth" }}</label>
|
||||
<label class="mb-0 d-block">{{ tr "sessions.template.list.authorized-on" }}</label>
|
||||
<p class="w-75 d-inline-block">
|
||||
<time datetime="{{ .CreatedAt }}">{{ .CreatedAt | date "Mon, 02 Jan 2006 15:04 MST" }}</time>
|
||||
</p>
|
||||
<label class="mb-0 d-block">{{ tr "session.template.form.label-IP" }}</label>
|
||||
<label class="mb-0 d-block">{{ tr "sessions.template.list.ip-address" }}</label>
|
||||
<p class="w-75 d-inline-block">{{ .RemoteAddr }}</p>
|
||||
{{ if .SameRemoteAddr}}
|
||||
<span class="badge badge-light float-right">{{ tr "session.template.form.span-machine" }}</span>
|
||||
<span class="badge badge-light float-right">{{ tr "sessions.template.list.same-machine" }}</span>
|
||||
{{ end }}
|
||||
<label class="mb-0 d-block">{{ tr "session.template.form.label-expire.title" }}</label>
|
||||
<label class="mb-0 d-block">{{ tr "sessions.template.list.expires" }}</label>
|
||||
<p class="w-75 d-inline-block">
|
||||
<time datetime="{{ .ExpiresAt }}">{{ .ExpiresAt | date "Mon, 02 Jan 2006 15:04 MST" }}</time>
|
||||
</p>
|
||||
{{ if .Expired }}
|
||||
<span class="badge badge-warning float-right">{{ tr "session.template.form.label-expire.expired" }}</span>
|
||||
<span class="badge badge-warning float-right">{{ tr "sessions.template.list.expired" }}</span>
|
||||
{{ else if eq .ExpiresIn 0 }}
|
||||
<span class="badge badge-warning float-right">{{ tr "session.template.form.label-expire.today" }}</span>
|
||||
<span class="badge badge-warning float-right">{{ tr "sessions.template.list.today" }}</span>
|
||||
{{ else if eq .ExpiresIn 1 }}
|
||||
<span class="badge badge-light float-right">{{ tr "session.template.form.label-expire.when" }}</span>
|
||||
<span class="badge badge-light float-right">{{ tr "sessions.template.list.tomorrow" }}</span>
|
||||
{{ else }}
|
||||
<span class="badge badge-light float-right">in {{ .ExpiresIn }} days</span>
|
||||
<span class="badge badge-light float-right">{{ tr "sessions.template.list.soon" "days" .ExpiresIn }}</span>
|
||||
{{ end }}
|
||||
<label class="mb-0 d-block">{{ tr "session.template.form.label-browser" }}</label>
|
||||
<label class="mb-0 d-block">{{ tr "sessions.template.list.browser" }}</label>
|
||||
<p class="small w-75 d-inline-block">
|
||||
{{ .UserAgent }}
|
||||
</p>
|
||||
{{ if .SameUserAgent}}
|
||||
<span class="badge badge-light float-right">{{ tr "session.template.form.span-browser" }}</span>
|
||||
<span class="badge badge-light float-right">{{ tr "sessions.template.list.same-browser" }}</span>
|
||||
{{ end }}
|
||||
</div>
|
||||
{{ end }}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
placeholder="{{ tr "signup.template.form.email.placeholder" }}"
|
||||
autocomplete="username"
|
||||
value="{{ .form.email }}"
|
||||
aria-label="{{ tr "signup.template.form.email.aria-label" }}">
|
||||
aria-label="{{ tr "signup.template.form.email.label" }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
@@ -38,7 +38,7 @@
|
||||
required
|
||||
placeholder="{{ tr "signup.template.form.password.placeholder" }}"
|
||||
autocomplete="new-password"
|
||||
aria-label="{{ tr "signup.template.form.password.aria-label" }}">
|
||||
aria-label="{{ tr "signup.template.form.password.label" }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
@@ -51,7 +51,7 @@
|
||||
placeholder="{{ tr "signup.template.form.name.placeholder" }}"
|
||||
value="{{ .form.name }}"
|
||||
autocomplete="name"
|
||||
aria-label="{{ tr "signup.template.form.name.aria-label" }}">
|
||||
aria-label="{{ tr "signup.template.form.name.label" }}">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label>
|
||||
@@ -64,7 +64,7 @@
|
||||
placeholder="{{ tr "signup.template.form.nickname.placeholder" }}"
|
||||
value="{{ .form.handle }}"
|
||||
autocomplete="handle"
|
||||
aria-label="{{ tr "signup.template.form.nickname.aria-label" }}">
|
||||
aria-label="{{ tr "signup.template.form.nickname.label" }}">
|
||||
</div>
|
||||
<div>
|
||||
<button
|
||||
@@ -74,8 +74,14 @@
|
||||
>{{ tr "signup.template.form.button.sign-up" }}</button>
|
||||
</div>
|
||||
</form>
|
||||
<<<<<<< HEAD
|
||||
<div class="text-center my-3">{{ tr "signup.template.form.link.alternative" }}
|
||||
<a href="{{ links.Login }}">{{ tr "signup.template.form.link.login" }}</a>
|
||||
=======
|
||||
<div class="text-center my-3">
|
||||
{{ tr "signup.template.log-in" "link" links.Login }}
|
||||
>>>>>>> 838e629a... Translation fixes
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ template "inc_footer.html.tpl" . }}
|
||||
|
||||
@@ -63,7 +63,7 @@ func (h *AuthHandlers) clientsProc(req *request.AuthReq) error {
|
||||
t := translator(req, "auth")
|
||||
req.NewAlerts = append(req.NewAlerts, request.Alert{
|
||||
Type: "primary",
|
||||
Text: t("authorized-clients.alerts.text"),
|
||||
Text: t("authorized-clients.alerts.removed"),
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,12 @@ func (h *AuthHandlers) logoutProc(req *request.AuthReq) (err error) {
|
||||
h.Log.Info("logout successful")
|
||||
|
||||
req.Template = TmplLogout
|
||||
req.Data["backlink"] = req.Request.FormValue("back")
|
||||
|
||||
if req.Request.FormValue("back") != "" {
|
||||
req.Data["link"] = req.Request.FormValue("back")
|
||||
} else {
|
||||
req.Data["link"] = GetLinks().Login
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ func (h AuthHandlers) mfaProc(req *request.AuthReq) (err error) {
|
||||
|
||||
t := translator(req, "auth")
|
||||
|
||||
req.PushAlert(t("mfa.handle.email-resent"))
|
||||
req.PushAlert(t("mfa.email.resent"))
|
||||
req.AuthUser.CompleteEmailOTP()
|
||||
|
||||
case "verifyTotp":
|
||||
@@ -75,7 +75,7 @@ func (h AuthHandlers) mfaProc(req *request.AuthReq) (err error) {
|
||||
|
||||
t := translator(req, "auth")
|
||||
|
||||
req.PushAlert(t("mfa.handle.topt-valid"))
|
||||
req.PushAlert(t("mfa.topt.valid"))
|
||||
req.AuthUser.CompleteTOTP()
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,6 @@ import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"html/template"
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
@@ -95,17 +94,13 @@ func (h AuthHandlers) oauth2AuthorizeClient(req *request.AuthReq) (err error) {
|
||||
t := translator(req, "auth")
|
||||
req.NewAlerts = append(req.NewAlerts, request.Alert{
|
||||
Type: "danger",
|
||||
Text: fmt.Sprintf(t("oauth2_authorize_client.alerts.no-auth-or-prems"), req.Client),
|
||||
Text: t("oauth2-authorize-client.alerts.denied", "client", req.Client.Meta.Name),
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
||||
if !req.AuthUser.User.EmailConfirmed {
|
||||
req.Data["invalidUser"] = template.HTML(fmt.Sprintf(
|
||||
`Cannot continue with unauthorized email, visit <a href="%s">your profile</a> and resolve the issue.`,
|
||||
GetLinks().Profile,
|
||||
))
|
||||
|
||||
req.Data["invalidUser"] = true
|
||||
req.Data["disabled"] = true
|
||||
} else if client.Trusted {
|
||||
h.Log.Debug("pre-authorized trusted oauth2 client")
|
||||
@@ -145,7 +140,7 @@ func (h AuthHandlers) oauth2AuthorizeClientProc(req *request.AuthReq) (err error
|
||||
t := translator(req, "auth")
|
||||
req.NewAlerts = append(req.NewAlerts, request.Alert{
|
||||
Type: "warning",
|
||||
Text: t("oauth2_authorize_client.alerts.client-access-denied"),
|
||||
Text: t("oauth2-authorize-client.alerts.denied", "client", req.Client.Meta.Name),
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ func (h *AuthHandlers) securityProc(req *request.AuthReq) error {
|
||||
t := translator(req, "auth")
|
||||
req.NewAlerts = append(req.NewAlerts, request.Alert{
|
||||
Type: "primary",
|
||||
Text: t("security.TFA-TOTP-disabled"),
|
||||
Text: t("security.totp-disabled"),
|
||||
})
|
||||
|
||||
// Make sure we update User's data in the session
|
||||
|
||||
@@ -22,6 +22,7 @@ import (
|
||||
"github.com/gorilla/csrf"
|
||||
"github.com/gorilla/sessions"
|
||||
"github.com/markbates/goth"
|
||||
"github.com/spf13/cast"
|
||||
"go.uber.org/zap"
|
||||
)
|
||||
|
||||
@@ -233,8 +234,13 @@ func (h *AuthHandlers) handle(fn handlerFn) http.HandlerFunc {
|
||||
// translator template function
|
||||
ttf = func(t *template.Template) *template.Template {
|
||||
return t.Funcs(map[string]interface{}{
|
||||
"tr": func(key string, pp ...string) string {
|
||||
return loc.Get(req.Context(), "auth", key, pp...)
|
||||
"tr": func(key string, pp ...interface{}) template.HTML {
|
||||
ss := make([]string, len(pp))
|
||||
for i := range pp {
|
||||
ss[i] = cast.ToString(pp[i])
|
||||
}
|
||||
|
||||
return template.HTML(loc.Get(req.Context(), "auth", key, ss...))
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
package locale
|
||||
+13
-2
@@ -183,9 +183,20 @@ func loadTranslations(lang *Language, dir string) (err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// wraps JSON with namespaces under each app with a language tag:
|
||||
// { <lang>: { namespace ..., namespace ... } }
|
||||
//
|
||||
// This simplifies and unifies the output and makes it compatible
|
||||
// with the frontend libs
|
||||
for app, nss := range auxExternal {
|
||||
var buf = &bytes.Buffer{}
|
||||
if err = json.NewEncoder(buf).Encode(nss); err != nil {
|
||||
var (
|
||||
buf = &bytes.Buffer{}
|
||||
aux = make(map[string]interface{})
|
||||
)
|
||||
|
||||
aux[lang.Tag.String()] = nss
|
||||
|
||||
if err = json.NewEncoder(buf).Encode(aux); err != nil {
|
||||
return
|
||||
}
|
||||
lang.external[app] = buf
|
||||
|
||||
Reference in New Issue
Block a user