{% extends 'partials/base.html.twig' %} {% set plugin_slug = admin.route %} {% if plugin_slug %} {% set installing = plugin_slug starts with 'install' %} {% if installing %} {% set title = "PLUGIN_ADMIN.PLUGINS"|tu %} {% else %} {% set installed = true %} {# Try installed packages first, then remote #} {% set package = admin.plugins(true)[admin.route] %} {% if (not package) %} {% set package = admin.plugins(false)[admin.route] %} {% set installed = false %} {% endif %} {% set plugin = package.toArray() %} {% set title = "PLUGIN_ADMIN.PLUGIN"|tu ~ ": " ~ plugin.name|e %} {% endif %} {% else %} {% set title = "PLUGIN_ADMIN.PLUGINS"|tu %} {% endif %} {% if admin.route or installing %} {% block stylesheets %} {% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %} {{ parent() }} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} {% endif %} {% block titlebar %} {% if not admin.route or installing %}
{% if (installing) %} {{ "PLUGIN_ADMIN.BACK"|tu }} {% else %} {{ "PLUGIN_ADMIN.BACK"|tu }} {{ "PLUGIN_ADMIN.ADD"|tu }} {% if authorize(['admin.maintenance', 'admin.super']) %} {% endif %} {% endif %}

{{ "PLUGIN_ADMIN.PLUGINS"|tu }}

{% else %} {% if (installed) %}
{{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|tu }} {% include 'plugins/'~admin.route~'-buttons.html.twig' ignore missing %}
{% else %}
{{ "PLUGIN_ADMIN.BACK_TO_PLUGINS"|tu }}
{% endif %}

{{ "PLUGIN_ADMIN.PLUGIN"|tu }}: {{ plugin.name|e }}

{% endif %} {% endblock %} {% block messages %} {{ parent() }} {% if config.plugins.admin.notifications.plugins %} {% endif %} {% endblock %} {% block content %}
{% if not admin.route or installing %} {% include 'partials/plugins-list.html.twig' %} {% else %} {% if plugin is null %} {{redirect_me(base_url_relative ~ '/404')}} {% endif %} {% include 'partials/plugins-details.html.twig' %} {% endif %}
{% endblock %}