mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-08-01 06:01:42 +00:00
53 lines
2.7 KiB
Twig
53 lines
2.7 KiB
Twig
|
|
{# @var user \App\Entity\UserSystem\User #}
|
||
|
|
{# @var connected_apps array<array{client: \League\Bundle\OAuth2ServerBundle\Model\ClientInterface, expiry: \DateTimeInterface}> #}
|
||
|
|
|
||
|
|
{% import "helper.twig" as helper %}
|
||
|
|
|
||
|
|
<div class="card mt-4">
|
||
|
|
<div class="card-header">
|
||
|
|
<i class="fa-solid fa-plug-circle-bolt fa-fw" aria-hidden="true"></i>
|
||
|
|
{% trans %}user.settings.oauth_connected_apps{% endtrans %}
|
||
|
|
</div>
|
||
|
|
<div class="card-body">
|
||
|
|
<span class="text-muted">{% trans %}user.settings.oauth_connected_apps.description{% endtrans %}</span>
|
||
|
|
|
||
|
|
{% if connected_apps is empty %}
|
||
|
|
<br><br>
|
||
|
|
<b>{% trans %}user.settings.oauth_connected_apps.none_yet{% endtrans %}</b>
|
||
|
|
<br><br>
|
||
|
|
{% else %}
|
||
|
|
<form action="{{ path('user_oauth_connected_apps_revoke') }}" method="post"
|
||
|
|
{{ stimulus_controller('elements/delete_btn') }} {{ stimulus_action('elements/delete_btn', "submit", "submit") }}
|
||
|
|
data-delete-title="{% trans %}user.settings.oauth_connected_apps.revoke.title{% endtrans %}"
|
||
|
|
data-delete-message="{% trans %}user.settings.oauth_connected_apps.revoke.message{% endtrans %}">
|
||
|
|
<input type="hidden" name="_method" value="DELETE">
|
||
|
|
<input type="hidden" name="_token" value="{{ csrf_token('delete' ~ user.id) }}">
|
||
|
|
<table class="table table-striped table-bordered table-hover table-sm mt-2">
|
||
|
|
<thead>
|
||
|
|
<tr>
|
||
|
|
<th>{% trans %}user.settings.oauth_connected_apps.app_name{% endtrans %}</th>
|
||
|
|
<th>{% trans %}user.settings.oauth_connected_apps.access_until{% endtrans %}</th>
|
||
|
|
<th></th>
|
||
|
|
</tr>
|
||
|
|
</thead>
|
||
|
|
|
||
|
|
<tbody>
|
||
|
|
{% for connected_app in connected_apps %}
|
||
|
|
<tr>
|
||
|
|
<td>{{ connected_app.client.name }}</td>
|
||
|
|
<td>{{ helper.format_date_nullable(connected_app.expiry) }}</td>
|
||
|
|
<td>
|
||
|
|
<button type="submit" class="btn btn-danger btn-sm" name="client_id"
|
||
|
|
value="{{ connected_app.client.identifier }}" {% if not is_granted('@api.manage_tokens') %}disabled="disabled"{% endif %}>
|
||
|
|
<i class="fas fa-trash-alt fa-fw"></i> {% trans %}user.settings.oauth_connected_apps.revoke{% endtrans %}
|
||
|
|
</button>
|
||
|
|
</td>
|
||
|
|
</tr>
|
||
|
|
{% endfor %}
|
||
|
|
</tbody>
|
||
|
|
</table>
|
||
|
|
</form>
|
||
|
|
{% endif %}
|
||
|
|
</div>
|
||
|
|
</div>
|