From 5eeddfde10302634bb7f90a81422becfdbc1e17e Mon Sep 17 00:00:00 2001 From: "Panagiotis \"Ivory\" Vasilopoulos" Date: Sat, 24 Jun 2023 13:00:52 +0000 Subject: [PATCH] Only show 'Manage Account Links' when necessary (#25311) If it is not possible to add or manage an account link, the menu will not be shown to the user. --- .../user/settings/security/accountlinks.tmpl | 27 ++++++++++--------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl index bcf432f69..cf3667d8a 100644 --- a/templates/user/settings/security/accountlinks.tmpl +++ b/templates/user/settings/security/accountlinks.tmpl @@ -1,3 +1,5 @@ +{{/* No account links, no way to add account links: Menu will not be shown. */}} +{{if or .AccountLinks .OrderedOAuth2Names}}

{{.locale.Tr "settings.manage_account_links"}} {{if .OrderedOAuth2Names}} @@ -23,20 +25,18 @@
{{.locale.Tr "settings.manage_account_links_desc"}}
- {{if .AccountLinks}} - {{range $loginSource, $provider := .AccountLinks}} -
-
- - {{$loginSource.Name}} - {{if $loginSource.IsActive}}{{$.locale.Tr "repo.settings.active"}}{{end}} - -
- + {{range $loginSource, $provider := .AccountLinks}} +
+
+ + {{$loginSource.Name}} + {{if $loginSource.IsActive}}{{$.locale.Tr "repo.settings.active"}}{{end}} +
- {{end}} + +
{{end}}
@@ -51,3 +51,4 @@ {{template "base/modal_actions_confirm" .}} +{{end}}