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 %}
|
2021-04-17 14:49:53 +02:00
|
|
|
<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 %}
|
2020-11-22 14:45:24 +01:00
|
|
|
<a href="{{ config.url }}" target="_blank" rel="noopener">
|
|
|
|
{{ __(config.name|default(name|capitalize)) }}
|
|
|
|
</a>
|
2020-11-15 18:47:30 +01:00
|
|
|
{% else %}
|
2020-11-22 14:45:24 +01:00
|
|
|
{{ __(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) %}
|
2022-12-10 02:24:20 +01:00
|
|
|
<form method="post" action="{{ url('/oauth/' ~ name ~ '/connect') }}">
|
2020-11-15 18:47:30 +01:00
|
|
|
{{ csrf() }}
|
|
|
|
|
2023-12-21 13:08:29 +01:00
|
|
|
{{ f.submit(__('form.connect'), {'size' : 'sm', 'icon_left': 'box-arrow-in-right'}) }}
|
2020-11-15 18:47:30 +01:00
|
|
|
</form>
|
|
|
|
{% else %}
|
2022-12-10 02:24:20 +01:00
|
|
|
<form method="post" action="{{ url('/oauth/' ~ name ~ '/disconnect') }}">
|
2020-11-15 18:47:30 +01:00
|
|
|
{{ csrf() }}
|
|
|
|
|
2023-12-21 13:08:29 +01:00
|
|
|
{{ f.submit(__('form.disconnect'), {'btn_type': 'danger', 'size' : 'sm', 'icon_left': 'box-arrow-right'}) }}
|
2020-11-15 18:47:30 +01:00
|
|
|
</form>
|
|
|
|
{% endif %}
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
{% endfor %}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{% endblock %}
|