{% extends 'partials/base.html.twig' %} {% macro spanToggle(input, length) %} {{ (repeat('  ', (length - input|length) / 2) ~ input ~ repeat('  ', (length - input|length) / 2))|raw }} {% endmacro %} {% if admin.route %} {% set context = admin.page(true) %} {% endif %} {% if uri.param('new') %} {% set mode = 'new' %} {% elseif context %} {% set mode = 'edit' %} {% if context.exists %} {% set page_url = base_url ~ '/pages' ~ (context.header.routes.default ?: context.rawRoute) %} {% set exists = true %} {% set title = (context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu ) ~ " " ~ (context.header.title ?: context.title) %} {% else %} {% set title = "PLUGIN_ADMIN.ADD_PAGE"|tu %} {% endif %} {% else %} {% set mode = 'list' %} {% set title = "PLUGIN_ADMIN.PAGES"|tu %} {% endif %} {% set modular = context.modular ? 'modular_' : '' %} {% set warn = config.plugins.admin.warnings.delete_page %} {% set admin_lang = admin.session.admin_lang ?: 'en' %} {% set page_lang = context.language %} {% set type = 'page' %} {% block stylesheets %} {% if mode == 'edit' %} {% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %} {% endif %} {{ parent() }} {% endblock %} {% block javascripts %} {{ parent() }} {% endblock %} {% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %} {% set preview_link = context.routable ? ' ' : '' %} {% macro loop(page, depth, twig_vars) %} {% set separator = twig_vars['config'].system.param_sep %} {% set base_url = twig_vars['base_url_relative'] %} {% set base_url_simple = twig_vars['base_url_simple'] %} {% set admin_route = twig_vars['admin_route'] %} {% set admin_lang = twig_vars['admin_lang'] %} {% set warn = twig_vars['warn'] %} {% set uri = twig_vars['uri'] %} {% if page.header.admin.children_display_order == 'collection' and page.header.content.order.by %} {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc')) %} {{ dump(pcol) }} {% else %} {% set pcol = page.children() %} {% endif %} {% for p in pcol %} {% set description = (not p.page ? "PLUGIN_ADMIN.FOLDER"|tu ~ ' • ' : "PLUGIN_ADMIN.PAGE"|tu ~ ' • ') ~ (p.modular ? "PLUGIN_ADMIN.MODULAR"|tu ~ ' • ' : '') ~ (p.routable ? "PLUGIN_ADMIN.ROUTABLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_ROUTABLE"|tu ~ ' • ') ~ (p.visible ? "PLUGIN_ADMIN.VISIBLE"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_VISIBLE"|tu ~ ' • ') ~ (p.published ? "PLUGIN_ADMIN.PUBLISHED"|tu ~ ' • ' : "PLUGIN_ADMIN.NON_PUBLISHED"|tu ~ ' • ') %} {#{% set page_route = p.rawRoute|trim('/') %}#} {#{% if p.language and p.language != admin_lang %}#} {#{% set page_url = base_url_simple ~ '/' ~ p.language ~ '/' ~ admin_route ~ '/pages/' ~ page_route %}#} {#{% else %}#} {#{% set page_url = base_url ~ '/pages/' ~ page_route %}#} {#{% endif %}#} {% set page_url = getPageUrl(p) %}
  • 0 ? 'data-toggle="children"' : ''}}> {{ p.title|e }} {% if p.language %} {{p.language}} {% endif %} {{ p.home ? '' }} {% if warn %} {% else %} {% endif %}

    {{ p.header.routes.default ?: p.route }} {{ p.template() }}

    {% if p.children().count > 0 %} {% endif %}
  • {% endfor %} {% endmacro %} {% block titlebar %}
    {% if mode == 'list' %} {{ "PLUGIN_ADMIN.BACK"|tu }}
    {% if admin.multilang %}
    {% if admin.languages_enabled|length > 1 %} {% endif %}
    {% endif %} {% elseif mode == 'edit' %} {{ preview_link|raw }} {{ "PLUGIN_ADMIN.BACK"|tu }} {% if exists %}
    {{ "PLUGIN_ADMIN.COPY"|tu }} {{ "PLUGIN_ADMIN.MOVE"|tu }} {% if config.plugins['admin-pro'].enabled %} {{ "PLUGIN_ADMIN_PRO.REVISIONS"|tu }} {% endif %} {% if warn %} {{ "PLUGIN_ADMIN.DELETE"|tu }} {% else %} {% endif %} {% endif %}
    {% if exists and admin.multilang %} {% if context.untranslatedLanguages %} {% endif %} {% endif %}
    {% endif %}
    {% if mode == 'new' %}

    {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }}

    {% elseif mode == 'edit' %}

    {{ context.exists ? "PLUGIN_ADMIN.EDIT"|tu : "PLUGIN_ADMIN.CREATE"|tu }} {{ context.menu }}

    {% else %}

    {{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}

    {% endif %} {% endblock %} {% block content %}
    {% if mode == 'new' %} {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/page'), data: context } %} {% elseif mode == 'edit' %}
    {% if admin.multilang and page_lang %}
    {% if exists and context.translatedLanguages|length > 1 %} {% endif %}
    {% endif %} {% if context.blueprints.fields %} {% set normalText = "PLUGIN_ADMIN.NORMAL"|tu %} {% set expertText = "PLUGIN_ADMIN.EXPERT"|tu %} {% set maxLen = max([normalText|length, expertText|length]) %} {% set normalText = _self.spanToggle(normalText, maxLen) %} {% set expertText = _self.spanToggle(expertText, maxLen) %}
    {% endif %}
    {% if context.blueprints.fields and admin.session.expert == '0' %} {% include 'partials/blueprints.html.twig' with { blueprints: context.blueprints, data: context } %} {% else %} {% include 'partials/blueprints-raw.html.twig' with { blueprints: admin.blueprints('admin/pages/'~modular~'raw'), data: context } %} {% endif %}
    {% else %}
    {{ "PLUGIN_ADMIN.EXPAND_ALL"|tu }} {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|tu }}
    {% include 'partials/page-legend.html.twig' %}
    {% endif %}
    {% if context %} {% set obj_data = clone(context) %} {% if mode == 'edit' %} {% do obj_data.folder('') %} {% endif %} {% endif %} {% if mode == 'list' or mode == 'edit' %}
    {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/new'), data: obj_data } %}
    {% include 'partials/blueprints-new-folder.html.twig' with { blueprints: admin.blueprints('admin/pages/new_folder'), data: obj_data } %}
    {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('admin/pages/modular_new'), data: obj_data } %}
    {% endif %} {% if mode == 'edit' %}
    {% include 'partials/page-move.html.twig' with { blueprints: admin.blueprints('admin/pages/move'), data: context } %}
    {% include ['partials/page-revisions.html.twig', 'empty.html.twig'] with { data: context } %}
    {% endif %} {% include 'partials/modal-changes-detected.html.twig' %}

    {{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE"|tu }}

    {% if context %} {{ "PLUGIN_ADMIN.PAGE"|tu }}: {{ context.title }} {% endif %}

    {{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}


    {{ "PLUGIN_ADMIN.CONTINUE"|tu }}
    {% include 'partials/admin-pro-pages-addons.html.twig' ignore missing %} {% endblock %}