aboutsummaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorPanagiotis "Ivory" Vasilopoulos <git@n0toose.net>2023-06-24 13:00:52 +0000
committerGitHub <noreply@github.com>2023-06-24 13:00:52 +0000
commit5eeddfde10302634bb7f90a81422becfdbc1e17e (patch)
treeb0c56ae715fe0f7a5207b6631f7f6f8d53df2f38 /templates
parent8e6a114317e6b6b137116f1b8e33c2290056cb6e (diff)
downloadgitea-5eeddfde10302634bb7f90a81422becfdbc1e17e.tar.gz
gitea-5eeddfde10302634bb7f90a81422becfdbc1e17e.zip
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.
Diffstat (limited to 'templates')
-rw-r--r--templates/user/settings/security/accountlinks.tmpl27
1 files changed, 14 insertions, 13 deletions
diff --git a/templates/user/settings/security/accountlinks.tmpl b/templates/user/settings/security/accountlinks.tmpl
index bcf432f690..cf3667d8a2 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}}
<h4 class="ui top attached header">
{{.locale.Tr "settings.manage_account_links"}}
{{if .OrderedOAuth2Names}}
@@ -23,20 +25,18 @@
<div class="item">
{{.locale.Tr "settings.manage_account_links_desc"}}
</div>
- {{if .AccountLinks}}
- {{range $loginSource, $provider := .AccountLinks}}
- <div class="item gt-df gt-ac">
- <div class="gt-f1">
- <span data-tooltip-content="{{$provider}}">
- {{$loginSource.Name}}
- {{if $loginSource.IsActive}}<span class="text primary">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
- </span>
- </div>
- <button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
- {{$.locale.Tr "settings.delete_key"}}
- </button>
+ {{range $loginSource, $provider := .AccountLinks}}
+ <div class="item gt-df gt-ac">
+ <div class="gt-f1">
+ <span data-tooltip-content="{{$provider}}">
+ {{$loginSource.Name}}
+ {{if $loginSource.IsActive}}<span class="text primary">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
+ </span>
</div>
- {{end}}
+ <button class="ui red tiny button delete-button" data-modal-id="delete-account-link" data-url="{{AppSubUrl}}/user/settings/security/account_link" data-id="{{$loginSource.ID}}">
+ {{$.locale.Tr "settings.delete_key"}}
+ </button>
+ </div>
{{end}}
</div>
</div>
@@ -51,3 +51,4 @@
</div>
{{template "base/modal_actions_confirm" .}}
</div>
+{{end}}