engelsystem/resources/views/pages/settings/oauth.twig

53 lines
1.7 KiB
Twig
Raw Permalink Normal View History

2020-11-15 18:47:30 +01:00
{% extends 'pages/settings/settings.twig' %}
{% import 'macros/form.twig' as f %}
{% block title %}{{ __('settings.oauth') }}{% endblock %}
{% block container_title %}
<h1 id="oauth-settings-title">
{{ __('settings.settings') }}
<small class="text-muted">{{ block('title') }}</small>
</h1>
2020-11-15 18:47:30 +01:00
{% endblock %}
{% block row_content %}
<table class="table table-striped">
2020-11-23 20:41:02 +01:00
<thead>
<tr>
<th>{{ __('settings.oauth.identity-provider') }}</th>
<th></th>
</tr>
</thead>
2020-11-15 18:47:30 +01:00
<tbody>
{% for name,config in providers %}
2021-07-24 18:19:53 +02:00
<tr{% if config.hidden|default(false) %} class="d-none"{% endif %}>
2020-11-23 20:41:02 +01:00
<td>
2020-11-15 18:47:30 +01:00
{% if config.url|default %}
<a href="{{ config.url }}" target="_blank" rel="noopener">
{{ __(config.name|default(name|capitalize)) }}
</a>
2020-11-15 18:47:30 +01:00
{% else %}
{{ __(config.name|default(name|capitalize)) }}
2020-11-15 18:47:30 +01:00
{% endif %}
2020-11-23 20:41:02 +01:00
</td>
2020-11-15 18:47:30 +01:00
<td>
{% if not user.oauth.contains('provider', name) %}
<form method="post" action="{{ url('/oauth/' ~ name ~ '/connect') }}">
2020-11-15 18:47:30 +01:00
{{ csrf() }}
2021-09-10 14:30:16 +02:00
{{ f.submit(__('form.connect'), {'size' : 'sm'}) }}
2020-11-15 18:47:30 +01:00
</form>
{% else %}
<form method="post" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
2020-11-15 18:47:30 +01:00
{{ csrf() }}
2021-09-10 14:30:16 +02:00
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm'}) }}
2020-11-15 18:47:30 +01:00
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}