forgejo/templates/user/settings/security/accountlinks.tmpl
silverwind a51b115b0a
Use inline SVG for built-in OAuth providers (#25171)
The plan is that all built-in auth providers use inline SVG for more
flexibility in styling and to get the GitHub icon to follow
`currentcolor`. This only removes the `public/img/auth` directory and
adds the missing svgs to our svg build.

It should map the built-in providers to these SVGs and render them. If
the user has set a Icon URL, it should render that as an `img` tag
instead.

```
gitea-azure-ad
gitea-bitbucket
gitea-discord
gitea-dropbox
gitea-facebook
gitea-gitea
gitea-gitlab
gitea-google
gitea-mastodon
gitea-microsoftonline
gitea-nextcloud
gitea-twitter
gitea-yandex
octicon-mark-github
```

GitHub logo is now white again on dark theme:

<img width="431" alt="Screenshot 2023-06-12 at 21 45 34"
src="https://github.com/go-gitea/gitea/assets/115237/27a43504-d60a-4132-a502-336b25883e4d">

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
2023-06-13 10:51:02 +00:00

53 lines
1.6 KiB
Handlebars

<h4 class="ui top attached header">
{{.locale.Tr "settings.manage_account_links"}}
{{if .OrderedOAuth2Names}}
<div class="ui right">
<div class="ui dropdown">
<div class="ui primary tiny button">{{.locale.Tr "settings.link_account"}}</div>
<div class="menu">
{{range $key := .OrderedOAuth2Names}}
{{$provider := index $.OAuth2Providers $key}}
<a class="item" href="{{AppSubUrl}}/user/oauth2/{{$key}}">
{{$provider.IconHTML}}
{{$provider.DisplayName}}
</a>
{{end}}
</div>
</div>
</div>
{{end}}
</h4>
<div class="ui attached segment">
<div class="ui key list">
<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>
</div>
{{end}}
{{end}}
</div>
</div>
<div class="ui g-modal-confirm delete modal" id="delete-account-link">
<div class="header">
{{svg "octicon-trash"}}
{{.locale.Tr "settings.remove_account_link"}}
</div>
<div class="content">
<p>{{.locale.Tr "settings.remove_account_link_desc"}}</p>
</div>
{{template "base/modal_actions_confirm" .}}
</div>