Skip to content

Commit 17cf06f

Browse files
committed
Only display button to link user accounts when at least one OAuth2 provider is active
1 parent 221c0af commit 17cf06f

File tree

1 file changed

+18
-16
lines changed

1 file changed

+18
-16
lines changed

templates/user/settings/security/accountlinks.tmpl

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<h4 class="ui top attached header">
22
{{.i18n.Tr "settings.manage_account_links"}}
3-
<div class="ui right">
4-
<div class="ui floating1 jump dropdown">
5-
<div class="ui blue tiny button">Link Account</div>
6-
<div class="menu">
7-
{{range $key := .OrderedOAuth2Names}}
8-
{{$provider := index $.OAuth2Providers $key}}
9-
<a class="item" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
10-
<img
11-
alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
12-
title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
13-
class="{{$provider.Name}} oauth-login-image"
14-
src="{{AppSubUrl}}{{$provider.Image}}"
15-
width="20" height="20">{{$provider.Name}}
16-
</a>
17-
{{end}}
3+
{{if .OrderedOAuth2Names}}
4+
<div class="ui right">
5+
<div class="ui floating1 jump dropdown">
6+
<div class="ui blue tiny button">Link Account</div>
7+
<div class="menu">
8+
{{range $key := .OrderedOAuth2Names}}
9+
{{$provider := index $.OAuth2Providers $key}}
10+
<a class="item" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
11+
<img
12+
alt="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
13+
title="{{$provider.DisplayName}}{{if eq $provider.Name "openidConnect"}} ({{$key}}){{end}}"
14+
class="{{$provider.Name}} oauth-login-image"
15+
src="{{AppSubUrl}}{{$provider.Image}}"
16+
width="20" height="20">{{$provider.Name}}
17+
</a>
18+
{{end}}
19+
</div>
1820
</div>
1921
</div>
20-
</div>
22+
{{end}}
2123
</h4>
2224
<div class="ui attached segment">
2325
<div class="ui key list">

0 commit comments

Comments
 (0)