{% extends 'partials/base.html.twig' %} {% 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' %} {% 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 %} {% block stylesheets %} {% if mode == 'edit' %} {% do assets.addCss(theme_url~'/css/codemirror/codemirror.css') %} {% endif %} {{ parent() }} {% endblock %} {% block javascripts %} {% do assets.addJs(theme_url~'/js/pages-all.js') %} {% do assets.addJs(theme_url~'/js/speakingurl.min.js') %} {% do assets.addJs(theme_url~'/js/slugify.min.js') %} {% if mode == 'edit' %} {% do assets.addJs(theme_url~'/js/codemirror-compressed.js') %} {% do assets.addJs(theme_url~'/js/mdeditor.js') %} {% do assets.addJs(theme_url~'/js/dropzone.min.js') %} {% endif %} {{ 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'] %} {% for p in page.children() %} {% set description = (not p.page ? 'Folder • ' : 'Page • ') ~ (p.modular ? 'Modular • ' : '') ~ (p.routable ? 'Routable • ' : 'Non-Routable • ') ~ (p.visible ? 'Visible • ' : 'Non-Visible • ') ~ (p.published ? 'Published • ' : 'Non-Published • ') %} {% 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 %}
  • 0 ? 'data-toggle="children"' : ''}} data-hint="{{ description|trim(' • ') }}" class="hint--bottom"> {{ p.title }} {% if p.language %} {{p.language ?: default_site_lang}} {% 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 }} {{ "PLUGIN_ADMIN.ADD_PAGE"|tu }} {% if admin.modularTypes is not empty %} {{ "PLUGIN_ADMIN.ADD_MODULAR"|tu }} {% endif %} {% if admin.multilang %}
    {% endif %} {% elseif mode == 'edit' %} {{ "PLUGIN_ADMIN.BACK"|tu }} {% if exists %} {{ "PLUGIN_ADMIN.COPY"|tu }} {{ "PLUGIN_ADMIN.MOVE"|tu }} {% 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 ~ " #{context.menu}" ~ preview_link : "PLUGIN_ADMIN.CREATE"|tu ~ " #{context.menu}" }}

    {% else %}

    {{ "PLUGIN_ADMIN.MANAGE_PAGES"|tu }}

    {% endif %} {% endblock %} {% block content %} {% set default_site_lang = grav.config.system.languages|first|first %}
    {% include 'partials/messages.html.twig' %} {% 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 %}
    {% 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('pages/'~modular~'raw'), data: context } %} {% endif %}
    {% else %}
    {{ "PLUGIN_ADMIN.EXPAND_ALL"|tu }} {{ "PLUGIN_ADMIN.COLLAPSE_ALL"|tu }}
    {% endif %}

    {{ "PLUGIN_ADMIN.ERROR"|tu }}

    {% if mode == 'list' %}
    {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/new'), data: context } %}
    {% include 'partials/blueprints-new.html.twig' with { blueprints: admin.blueprints('pages/modular_new'), data: context } %}
    {% endif %} {% if mode == 'edit' %}
    {% include 'partials/page-move.html.twig' with { blueprints: admin.blueprints('pages/move'), data: context } %}
    {% endif %}

    {{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_TITLE"|tu }}

    {{ "PLUGIN_ADMIN.MODAL_DELETE_PAGE_CONFIRMATION_REQUIRED_DESC"|tu }}


    {{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_TITLE"|tu }}

    {{ "PLUGIN_ADMIN.MODAL_CHANGED_DETECTED_DESC"|tu }}


    {{ "PLUGIN_ADMIN.MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_TITLE"|tu }}

    {{ "PLUGIN_ADMIN.MODAL_DELETE_FILE_CONFIRMATION_REQUIRED_DESC"|tu }}


    {% endblock %}