From e68b9d00a6e05b3a941f63ffb696f91e554ac5ec Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 18 Oct 2024 20:33:49 +0200 Subject: Adding upstream version 9.0.3. Signed-off-by: Daniel Baumann --- templates/user/settings/security/accountlinks.tmpl | 62 +++++++++++++++++++++ templates/user/settings/security/openid.tmpl | 63 ++++++++++++++++++++++ templates/user/settings/security/security.tmpl | 11 ++++ templates/user/settings/security/twofa.tmpl | 37 +++++++++++++ templates/user/settings/security/twofa_enroll.tmpl | 25 +++++++++ templates/user/settings/security/webauthn.tmpl | 43 +++++++++++++++ 6 files changed, 241 insertions(+) create mode 100644 templates/user/settings/security/accountlinks.tmpl create mode 100644 templates/user/settings/security/openid.tmpl create mode 100644 templates/user/settings/security/security.tmpl create mode 100644 templates/user/settings/security/twofa.tmpl create mode 100644 templates/user/settings/security/twofa_enroll.tmpl create mode 100644 templates/user/settings/security/webauthn.tmpl (limited to 'templates/user/settings/security') diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl new file mode 100644 index 0000000..0820844 --- /dev/null +++ b/templates/user/settings/security/accountlinks.tmpl @@ -0,0 +1,62 @@ +{{/* No account links, no way to add account links: Menu will not be shown. */}} +{{if or .AccountLinks .OrderedOAuth2Names}} +

+ {{ctx.Locale.Tr "settings.manage_account_links"}} + {{if .OrderedOAuth2Names}} +
+ +
+ {{end}} +

+ +
+
+
+ {{ctx.Locale.Tr "settings.manage_account_links_desc"}} +
+ {{range $loginSource, $provider := .AccountLinks}} +
+ {{$providerData := index $.OAuth2Providers $loginSource.Name}} +
+ {{$providerData.IconHTML 20}} +
+
+ + {{$loginSource.Name}} + + {{if $loginSource.IsActive}} + {{ctx.Locale.Tr "repo.settings.active"}} + {{end}} +
+
+ +
+
+ {{end}} +
+ + +
+{{end}} diff --git a/templates/user/settings/security/openid.tmpl b/templates/user/settings/security/openid.tmpl new file mode 100644 index 0000000..b0473c9 --- /dev/null +++ b/templates/user/settings/security/openid.tmpl @@ -0,0 +1,63 @@ +

+ {{ctx.Locale.Tr "settings.manage_openid"}} +

+
+
+
+ {{ctx.Locale.Tr "settings.openid_desc"}} +
+ {{range .OpenIDs}} +
+
+ {{svg "fontawesome-openid" 20}} +
+
+
{{.URI}}
+
+
+
+ {{$.CsrfTokenHtml}} + + {{if .Show}} + + {{else}} + + {{end}} +
+ +
+
+ {{end}} +
+
+
+
+ {{.CsrfTokenHtml}} +
+ + +
+ +
+ + +
diff --git a/templates/user/settings/security/security.tmpl b/templates/user/settings/security/security.tmpl new file mode 100644 index 0000000..aee0456 --- /dev/null +++ b/templates/user/settings/security/security.tmpl @@ -0,0 +1,11 @@ +{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings security")}} +
+ {{template "user/settings/security/twofa" .}} + {{template "user/settings/security/webauthn" .}} + {{template "user/settings/security/accountlinks" .}} + {{if .EnableOpenIDSignIn}} + {{template "user/settings/security/openid" .}} + {{end}} +
+ +{{template "user/settings/layout_footer" .}} diff --git a/templates/user/settings/security/twofa.tmpl b/templates/user/settings/security/twofa.tmpl new file mode 100644 index 0000000..adebce4 --- /dev/null +++ b/templates/user/settings/security/twofa.tmpl @@ -0,0 +1,37 @@ +

+ {{ctx.Locale.Tr "settings.twofa"}} +

+
+

{{ctx.Locale.Tr "settings.twofa_desc"}}

+ {{if .TOTPEnrolled}} +

{{ctx.Locale.Tr "settings.twofa_is_enrolled"}}

+
+ {{.CsrfTokenHtml}} +

{{ctx.Locale.Tr "settings.regenerate_scratch_token_desc"}}

+ +
+
+ {{.CsrfTokenHtml}} +

{{ctx.Locale.Tr "settings.twofa_disable_note"}}

+ +
+ {{else}} + {{/* The recovery tip is there as a means of encouraging a user to enroll */}} +

{{ctx.Locale.Tr "settings.twofa_recovery_tip"}}

+

{{ctx.Locale.Tr "settings.twofa_not_enrolled"}}

+ + {{end}} + + +
diff --git a/templates/user/settings/security/twofa_enroll.tmpl b/templates/user/settings/security/twofa_enroll.tmpl new file mode 100644 index 0000000..d6bfadf --- /dev/null +++ b/templates/user/settings/security/twofa_enroll.tmpl @@ -0,0 +1,25 @@ +{{template "user/settings/layout_head" (dict "ctxData" . "pageClass" "user settings twofa")}} +
+

+ {{ctx.Locale.Tr "settings.twofa_enroll"}} +

+
+

{{ctx.Locale.Tr "settings.scan_this_image"}}

+ {{.TwofaSecret}} +

{{ctx.Locale.Tr "settings.or_enter_secret" .TwofaSecret}}

+

{{ctx.Locale.Tr "settings.then_enter_passcode"}}

+
+ {{.CsrfTokenHtml}} +
+ + +
+
+ + +
+
+
+
+ +{{template "user/settings/layout_footer" .}} diff --git a/templates/user/settings/security/webauthn.tmpl b/templates/user/settings/security/webauthn.tmpl new file mode 100644 index 0000000..346f61c --- /dev/null +++ b/templates/user/settings/security/webauthn.tmpl @@ -0,0 +1,43 @@ +

{{ctx.Locale.Tr "settings.webauthn"}}

+
+

{{ctx.Locale.Tr "settings.webauthn_desc" "https://w3c.github.io/webauthn/#webauthn-authenticator"}}

+

{{ctx.Locale.Tr "settings.webauthn_key_loss_warning"}} {{ctx.Locale.Tr "settings.webauthn_alternative_tip"}}

+ {{template "user/auth/webauthn_error" .}} +
+ {{range .WebAuthnCredentials}} +
+
+ {{svg "octicon-key" 32}} +
+
+
{{.Name}}
+
+

{{ctx.Locale.Tr "settings.added_on" (DateTime "short" .CreatedUnix)}}

+
+
+
+ +
+
+ {{end}} +
+
+
+ + +
+ +
+ +
-- cgit v1.2.3