mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-12-28 02:44:02 +01:00
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.
This commit is contained in:
parent
8e6a114317
commit
5eeddfde10
1 changed files with 14 additions and 13 deletions
|
@ -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">
|
<h4 class="ui top attached header">
|
||||||
{{.locale.Tr "settings.manage_account_links"}}
|
{{.locale.Tr "settings.manage_account_links"}}
|
||||||
{{if .OrderedOAuth2Names}}
|
{{if .OrderedOAuth2Names}}
|
||||||
|
@ -23,20 +25,18 @@
|
||||||
<div class="item">
|
<div class="item">
|
||||||
{{.locale.Tr "settings.manage_account_links_desc"}}
|
{{.locale.Tr "settings.manage_account_links_desc"}}
|
||||||
</div>
|
</div>
|
||||||
{{if .AccountLinks}}
|
{{range $loginSource, $provider := .AccountLinks}}
|
||||||
{{range $loginSource, $provider := .AccountLinks}}
|
<div class="item gt-df gt-ac">
|
||||||
<div class="item gt-df gt-ac">
|
<div class="gt-f1">
|
||||||
<div class="gt-f1">
|
<span data-tooltip-content="{{$provider}}">
|
||||||
<span data-tooltip-content="{{$provider}}">
|
{{$loginSource.Name}}
|
||||||
{{$loginSource.Name}}
|
{{if $loginSource.IsActive}}<span class="text primary">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
|
||||||
{{if $loginSource.IsActive}}<span class="text primary">{{$.locale.Tr "repo.settings.active"}}</span>{{end}}
|
</span>
|
||||||
</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>
|
|
||||||
</div>
|
</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}}
|
{{end}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -51,3 +51,4 @@
|
||||||
</div>
|
</div>
|
||||||
{{template "base/modal_actions_confirm" .}}
|
{{template "base/modal_actions_confirm" .}}
|
||||||
</div>
|
</div>
|
||||||
|
{{end}}
|
||||||
|
|
Loading…
Reference in a new issue