{% extends 'pages/settings/settings.twig' %} {% import 'macros/form.twig' as f %} {% block title %}{{ __('settings.api') }}{% endblock %} {% block row_content %}
{{ f.button( __('settings.api.key_show'), {'size': 'sm', 'icon_left': 'key', 'attr': { 'data-bs-toggle': 'collapse', 'data-bs-target': '#key_hide', 'aria-expanded': 'true', 'aria-controls': 'key_hide' }} ) }} {% if has_permission_to('shifts_json_export') %} {{ f.button( __('settings.api.shifts_json_show'), {'size': 'sm', 'icon_left': 'braces', 'attr': { 'data-bs-toggle': 'collapse', 'data-bs-target': '#shifts_json_hide', 'aria-expanded': 'true', 'aria-controls': 'shifts_json_hide' }} ) }} {% endif %} {% if has_permission_to('ical') %} {{ f.button( __('settings.api.ical_show'), {'size': 'sm', 'icon_left': 'calendar-week', 'attr': { 'data-bs-toggle': 'collapse', 'data-bs-target': '#ical_hide', 'aria-expanded': 'true', 'aria-controls': 'ical_hide' }} ) }} {% endif %} {% if has_permission_to('atom') %} {{ f.button( __('settings.api.news_show'), {'size': 'sm', 'icon_left': 'calendar-week', 'attr': { 'data-bs-toggle': 'collapse', 'data-bs-target': '#news_hide', 'aria-expanded': 'true', 'aria-controls': 'news_hide' }} ) }} {% endif %}
{{ csrf() }} {{ f.submit( __('settings.api.key_reset'), { 'size': 'sm', 'btn_type': 'danger', 'icon_left': 'arrow-repeat', 'confirm_text': __('settings.api.key_reset_confirm') } ) }}

{{ user.api_key }}

{% if has_permission_to('shifts_json_export') %}

{{ url('/shifts-json-export', {'key': user.api_key}) }}

{% endif %} {% if has_permission_to('ical') %}

{{ url('/ical', {'key': user.api_key}) }}

{% endif %} {% if has_permission_to('atom') %}

{{ url('/atom', {'key': user.api_key}) }} {% if has_permission_to('user_meetings') %}
{{ url('/atom', {'meetings': 1, 'key': user.api_key}) }} {% endif %}
{{ url('/rss', {'key': user.api_key}) }} {% if has_permission_to('user_meetings') %}
{{ url('/rss', {'meetings': 1, 'key': user.api_key}) }} {% endif %}

{% endif %}
{% if has_permission_to('api') %} {{ __('settings.api.about', [ config('app_name'), url('/api/v0-beta'), url('/api/v0-beta/openapi') ])|markdown|nl2br }} {% endif %} {{ __('settings.api.about.warning')|markdown|nl2br }}
{% endblock %}