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

50 lines
1.7 KiB
Twig
Raw 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>{{ 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 %}
<tr{% if config.hidden|default(false) %} class="hidden"{% 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') }}">
{{ csrf() }}
2020-11-23 20:41:02 +01:00
{{ f.submit(__('form.connect'), {'btn_size' : 'xs'}) }}
2020-11-15 18:47:30 +01:00
</form>
{% else %}
<form method="POST" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
{{ csrf() }}
2020-11-23 20:41:02 +01:00
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'btn_size' : 'xs'}) }}
2020-11-15 18:47:30 +01:00
</form>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endblock %}