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

53 lines
1.8 KiB
Twig

{% 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>
{% endblock %}
{% block row_content %}
<table class="table table-striped">
<thead>
<tr>
<th>{{ __('settings.oauth.identity-provider') }}</th>
<th></th>
</tr>
</thead>
<tbody>
{% for name,config in providers %}
<tr{% if config.hidden|default(false) %} class="d-none"{% endif %}>
<td>
{% if config.url|default %}
<a href="{{ config.url }}" target="_blank" rel="noopener">
{{ __(config.name|default(name|capitalize)) }}
</a>
{% else %}
{{ __(config.name|default(name|capitalize)) }}
{% endif %}
</td>
<td>
{% if not user.oauth.contains('provider', name) %}
<form method="post" action="{{ url('/oauth/' ~ name ~ '/connect') }}">
{{ csrf() }}
{{ f.submit(__('form.connect'), {'size' : 'sm', 'icon_left': 'box-arrow-in-right'}) }}
</form>
{% else %}
<form method="post" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
{{ csrf() }}
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm', 'icon_left': 'box-arrow-right'}) }}
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}