webseite-grav/plugins/admin/themes/grav/templates/config.html.twig

83 lines
3.4 KiB
Twig
Raw Normal View History

2021-04-30 11:23:26 +02:00
{% extends 'partials/base.html.twig' %}
{% set configurations = admin.configurations(true) %}
{% set config_slug = admin.route %}
{% if not config_slug %}
{% set config_slug = configurations|first %}
{% do admin.redirect('config/' ~ config_slug, 302) %}
{% endif %}
{% set isInfo = (config_slug == 'info') %}
{% set tab_title_string = "PLUGIN_ADMIN." ~ config_slug|upper %}
{% set tab_title = (tab_title_string|tu == tab_title_string ? config_slug|capitalize : tab_title_string|tu) ?: 'Not Found' %}
{% set title = "PLUGIN_ADMIN.CONFIGURATION"|tu ~ ": " ~ tab_title %}
{% if config_slug and not isInfo %}
{% set data = admin.data('config/' ~ config_slug) %}
{% endif %}
{% block stylesheets %}
{% do assets.addCss(theme_url ~ '/css/codemirror/codemirror.css') %}
{{ parent() }}
{% endblock %}
{% block javascripts %}
{{ parent() }}
{% endblock %}
{% block titlebar %}
<div class="button-bar">
<a class="button" href="{{ admin_route('/') }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
{% if data.file.filename %}
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
{% endif %}
</div>
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ tab_title }}</h1>
{% endblock %}
{% block content_top %}
{% if authorize('admin.super') and data.file.filename %}
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
{% endif %}
<div class="form-tabs">
<div class="tabs-nav">
{% for configuration in configurations %}
<a {% if config_slug == configuration %}class="active"{% endif %} href="{{ admin_route('/config/' ~ configuration) }}">
{% set configuration_string = "PLUGIN_ADMIN." ~ configuration|upper %}
<span>{{ (configuration_string|tu == configuration_string ? configuration|capitalize : configuration_string|tu) }}</span>
</a>
{% endfor %}
</div>
</div>
{% endblock %}
{% block content %}
{% set accessChangelog = authorize(['admin.maintenance', 'admin.super']) %}
{% if config_slug in configurations %}
{% if isInfo %}
<div id="phpinfo">
{% if accessChangelog %}
<div style="margin-left:1.5rem">
<a class="button button-big" href="#" style="text-align: center;" data-remodal-target="changelog" data-remodal-changelog="{{ admin_route('/changelog/type:plugins/slug:' ~ plugin.slug) }}"><i class="fa fa-binoculars"></i> View Grav Changelog</a>
</div>
{% endif %}
{{ admin.phpinfo|raw }}
</div>
{% else %}
<div class="config-wrapper-{{ config_slug }}">
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
</div>
{% endif %}
{% include 'partials/modal-changes-detected.html.twig' %}
{% if accessChangelog %}
{% include 'partials/modal-changelog.html.twig' %}
{% endif %}
{% else %}
{% do page.modifyHeader('http_response_code', 404) %}
<div class="config-wrapper">
<h2>Not found</h2>
</div>
{% endif %}
{% endblock %}