mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-08 08:33:01 +01:00
Revert "Prepend config with authorize check"
This reverts commit 25c10e297e.
This commit is contained in:
@@ -1,74 +1,72 @@
|
||||
{% extends 'partials/base.html.twig' %}
|
||||
|
||||
{% if authorize(['admin.configuration', 'admin.super']) %}
|
||||
{% set config_slug = uri.basename %}
|
||||
{% set isInfo = (config_slug == 'info') %}
|
||||
|
||||
{% set config_slug = uri.basename %}
|
||||
{% set isInfo = (config_slug == 'info') %}
|
||||
{% set title = "PLUGIN_ADMIN.CONFIGURATION"|tu ~ ": " ~ ("PLUGIN_ADMIN." ~ config_slug|upper)|tu %}
|
||||
|
||||
{% set title = "PLUGIN_ADMIN.CONFIGURATION"|tu ~ ": " ~ ("PLUGIN_ADMIN." ~ config_slug|upper)|tu %}
|
||||
|
||||
{% if 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 %}
|
||||
{% do assets.addJs(theme_url~'/js/codemirror-compressed.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/mdeditor.js') %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ ("PLUGIN_ADMIN." ~ config_slug|upper)|tu }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
|
||||
<ul class="tab-bar">
|
||||
<li {% if config_slug == 'system' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'system' %}<span>{% else %}<a href="{{ base_url_relative }}/config/system">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.SYSTEM"|tu }}
|
||||
{% if config_slug == 'system' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
<li {% if config_slug == 'site' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'site' %}<span>{% else %}<a href="{{ base_url_relative }}/config/site">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.SITE"|tu }}
|
||||
{% if config_slug == 'site' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
|
||||
{% for configuration in admin.configurations %}
|
||||
{% if configuration != 'system' and configuration != 'site' and admin.data('config/' ~ configuration).blueprints.fields is not empty %}
|
||||
<li {% if config_slug == configuration %}class="active"{% endif %}>
|
||||
{% if config_slug == configuration %}<span>{% else %}<a href="{{ base_url_relative }}/config/{{configuration}}">{% endif %}
|
||||
{{ configuration|tu|capitalize }}
|
||||
{% if config_slug == configuration %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<li {% if config_slug == 'info' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'info' %}<span>{% else %}<a href="{{ base_url_relative }}/config/info">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.INFO"|tu }}
|
||||
{% if config_slug == 'info' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if isInfo %}
|
||||
<div id="phpinfo">
|
||||
{{ admin.phpinfo }}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
{% if 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 %}
|
||||
{% do assets.addJs(theme_url~'/js/codemirror-compressed.js') %}
|
||||
{% do assets.addJs(theme_url~'/js/mdeditor.js') %}
|
||||
{{ parent() }}
|
||||
{% endblock %}
|
||||
|
||||
{% block titlebar %}
|
||||
<div class="button-bar">
|
||||
<a class="button" href="{{ base_url }}"><i class="fa fa-reply"></i> {{ "PLUGIN_ADMIN.BACK"|tu }}</a>
|
||||
<button class="button" type="submit" name="task" value="save" form="blueprints"><i class="fa fa-check"></i> {{ "PLUGIN_ADMIN.SAVE"|tu }}</button>
|
||||
</div>
|
||||
<h1><i class="fa fa-fw fa-wrench"></i> {{ "PLUGIN_ADMIN.CONFIGURATION"|tu }} - {{ ("PLUGIN_ADMIN." ~ config_slug|upper)|tu }}</h1>
|
||||
{% endblock %}
|
||||
|
||||
{% block content_top %}
|
||||
<div class="alert notice">{{ "PLUGIN_ADMIN.SAVE_LOCATION"|tu }}: <b>{{ data.file.filename|replace({(base_path):''}) }}</b></div>
|
||||
<ul class="tab-bar">
|
||||
<li {% if config_slug == 'system' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'system' %}<span>{% else %}<a href="{{ base_url_relative }}/config/system">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.SYSTEM"|tu }}
|
||||
{% if config_slug == 'system' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
<li {% if config_slug == 'site' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'site' %}<span>{% else %}<a href="{{ base_url_relative }}/config/site">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.SITE"|tu }}
|
||||
{% if config_slug == 'site' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
|
||||
{% for configuration in admin.configurations %}
|
||||
{% if configuration != 'system' and configuration != 'site' and admin.data('config/' ~ configuration).blueprints.fields is not empty %}
|
||||
<li {% if config_slug == configuration %}class="active"{% endif %}>
|
||||
{% if config_slug == configuration %}<span>{% else %}<a href="{{ base_url_relative }}/config/{{configuration}}">{% endif %}
|
||||
{{ configuration|tu|capitalize }}
|
||||
{% if config_slug == configuration %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
|
||||
<li {% if config_slug == 'info' %}class="active"{% endif %}>
|
||||
{% if config_slug == 'info' %}<span>{% else %}<a href="{{ base_url_relative }}/config/info">{% endif %}
|
||||
{{ "PLUGIN_ADMIN.INFO"|tu }}
|
||||
{% if config_slug == 'info' %}</span>{% else %}</a>{% endif %}
|
||||
</li>
|
||||
</ul>
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% if isInfo %}
|
||||
<div id="phpinfo">
|
||||
{{ admin.phpinfo }}
|
||||
</div>
|
||||
{% else %}
|
||||
{% include 'partials/blueprints.html.twig' with { blueprints: data.blueprints, data: data } %}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user