111 lines
4.1 KiB
Twig
111 lines
4.1 KiB
Twig
{% extends 'pages/settings/settings.twig' %}
|
|
{% import 'macros/form.twig' as f %}
|
|
|
|
{% block title %}{{ __('settings.api') }}{% endblock %}
|
|
|
|
{% block row_content %}
|
|
|
|
<div content="row">
|
|
<div class="col-md-12">
|
|
|
|
{{ 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 %}
|
|
|
|
<form method="post" class="d-inline">
|
|
{{ csrf() }}
|
|
{{ f.submit(
|
|
__('settings.api.key_reset'),
|
|
{
|
|
'size': 'sm', 'btn_type': 'danger',
|
|
'icon_left': 'arrow-repeat', 'confirm_text': __('settings.api.key_reset_confirm')
|
|
}
|
|
) }}
|
|
</form>
|
|
|
|
</div>
|
|
|
|
<div class="col-md-12 pt-2" id="exports_hide">
|
|
|
|
<p id="key_hide" class="collapse" data-bs-parent="#exports_hide">
|
|
<code>{{ user.api_key }}</code>
|
|
</p>
|
|
|
|
{% if has_permission_to('shifts_json_export') %}
|
|
<p id="shifts_json_hide" class="collapse" data-bs-parent="#exports_hide">
|
|
<code>{{ url('/shifts-json-export', {'key': user.api_key}) }}</code>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if has_permission_to('ical') %}
|
|
<p id="ical_hide" class="collapse" data-bs-parent="#exports_hide">
|
|
<code>{{ url('/ical', {'key': user.api_key}) }}</code>
|
|
</p>
|
|
{% endif %}
|
|
|
|
{% if has_permission_to('atom') %}
|
|
<p id="news_hide" class="collapse" data-bs-parent="#exports_hide">
|
|
<code>{{ url('/atom', {'key': user.api_key}) }}</code>
|
|
{% if has_permission_to('user_meetings') %}
|
|
<br><code>{{ url('/atom', {'meetings': 1, 'key': user.api_key}) }}</code>
|
|
{% endif %}
|
|
<br><code>{{ url('/rss', {'key': user.api_key}) }}</code>
|
|
{% if has_permission_to('user_meetings') %}
|
|
<br><code>{{ url('/rss', {'meetings': 1, 'key': user.api_key}) }}</code>
|
|
{% endif %}
|
|
</p>
|
|
{% endif %}
|
|
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row">
|
|
<div class="col-md-12">
|
|
{% 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 }}
|
|
</div>
|
|
</div>
|
|
|
|
{% endblock %}
|