{% 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 %} {% if config.plugins.admin.frontend_preview_target != 'inline' %} {% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %} {% set preview_target = config.plugins.admin.frontend_preview_target %} {% set preview_link = context.routable ? ' ' : '' %} {% else %} {% set preview_html = (base_url|rtrim('/') ~ '/preview' ~ (context.home ? '' : context.route)) ?: '/' %} {% set preview_link = context.routable ? ' ' : '' %} {% endif %} {% macro loop(page, depth, twig_vars) %} {% set config = twig_vars['config'] %} {% set separator = config.system.param_sep %} {% set display_field = config.plugins.admin.pages_list_display_field %} {% set base_url = twig_vars['base_url_relative'] %} {% set base_url_relative_frontend = twig_vars['base_url_relative_frontend'] %} {% 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 %} {% if page.header.content.order.custom %} {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc'), page.header.content.order.custom) %} {% else %} {% set pcol = page.children().order(page.header.content.order.by, page.header.content.order.dir|default('asc')) %} {% endif %} {% 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_url = getPageUrl(p) %}
{{ p.header.routes.default ?: p.route }} {{ p.template() }}