{# purpose of this template: routes display view #}
{% set baseTemplate = app.request.query.getBoolean('raw', false) ? 'raw' : (routeArea == 'admin' ? 'adminBase' : 'base') %}
{% extends '@ZikulaRoutesModule/' ~ baseTemplate ~ '.html.twig' %}
{% block pageTitle %}{{ route|zikularoutesmodule_formattedTitle|default('Route'|trans) }}{% endblock %}
{% block title %}
    {% set isQuickView = app.request.query.getBoolean('raw', false) %}
    {% set templateTitle = route|zikularoutesmodule_formattedTitle|default('Route'|trans) %}
    {{ templateTitle }}
    {% if not isQuickView %}
        {% set itemActions = knp_menu_get('zikulaRoutesMenuItemActions', [], {entity: route, area: routeArea, context: 'display'}) %}
        <div class="dropdown item-actions">
            <a id="itemActions{{ route.getKey() }}DropDownToggleStart" role="button" data-toggle="dropdown" href="javascript:void(0);" class="d-none dropdown-toggle"><i class="fas fa-tasks"></i> {% trans %}Actions{% endtrans %}</a>
            {{ knp_menu_render(itemActions, {template: '@ZikulaMenuModule/Override/bootstrap_fontawesome.html.twig'}) }}
        </div>
    {% endif %}
{% endblock %}
{% block admin_page_icon 'eye' %}
{% block content %}
    {% set isQuickView = app.request.query.getBoolean('raw', false) %}
    <div class="zikularoutesmodule-route zikularoutesmodule-display">
        <dl>
            {% if route.bundle is not empty %}
                <dt>{% trans %}Bundle{% endtrans %}</dt>
                <dd>{{ route.bundle }}</dd>
            {% endif %}
            {% if route.controller is not empty %}
                <dt>{% trans %}Controller{% endtrans %}</dt>
                <dd>{{ route.controller }}</dd>
            {% endif %}
            {% if route.action is not empty %}
                <dt>{% trans %}Action{% endtrans %}</dt>
                <dd>{{ route.action }}</dd>
            {% endif %}
            {% if route.path is not empty %}
                <dt>{% trans %}Path{% endtrans %}</dt>
                <dd>{{ route.path|zikularoutesmodule_pathToString(route) }}</dd>
            {% endif %}
            {% if route.description is not empty %}
                <dt>{% trans %}Description{% endtrans %}</dt>
                <dd>{{ route.description }}</dd>
            {% endif %}
            {#% if route.sort is not empty %}
                <dt>{% trans %}Sort{% endtrans %}</dt>
                <dd>{{ route.sort }}</dd>
            {% endif %#}
            <dt>{% trans %}Prepend bundle prefix{% endtrans %}</dt>
            <dd>{% if route.prependBundlePrefix %}
                <i class="fas fa-check text-success" title="{{ 'Yes'|trans|e('html_attr') }}"></i>
            {% else %}
                <i class="fas fa-times text-danger" title="{{ 'No'|trans|e('html_attr') }}"></i>
            {% endif %}
            </dd>
            <dt>{% trans %}Translatable{% endtrans %}</dt>
            <dd>{% if route.translatable %}
                <i class="fas fa-check text-success" title="{{ 'Yes'|trans|e('html_attr') }}"></i>
            {% else %}
                <i class="fas fa-times text-danger" title="{{ 'No'|trans|e('html_attr') }}"></i>
            {% endif %}
            </dd>
            {% if route.translationPrefix is not empty %}
                <dt>{% trans %}Translation prefix{% endtrans %}</dt>
                <dd>{{ route.translationPrefix }}</dd>
            {% endif %}
            {% if route.schemes is not empty %}
                <dt>{% trans %}Schemes{% endtrans %}</dt>
                <dd>{{ route.schemes|zikularoutesmodule_listEntry('route', 'schemes') }}</dd>
            {% endif %}
            {% if route.methods is not empty %}
                <dt>{% trans %}Methods{% endtrans %}</dt>
                <dd>{{ route.methods|zikularoutesmodule_listEntry('route', 'methods') }}</dd>
            {% endif %}
            {% if route.defaults is not empty %}
                <dt>{% trans %}Defaults{% endtrans %}</dt>
                <dd>{{ route.defaults|zikularoutesmodule_arrayToString }}</dd>
            {% endif %}
            {% if route.requirements is not empty %}
                <dt>{% trans %}Requirements{% endtrans %}</dt>
                <dd>{{ route.requirements|zikularoutesmodule_arrayToString }}</dd>
            {% endif %}
            {% if route.options is not empty %}
                <dt>{% trans %}Options{% endtrans %}</dt>
                <dd>{{ route.options|zikularoutesmodule_arrayToString }}</dd>
            {% endif %}
            {% if route.host is not empty %}
                <dt>{% trans %}Host{% endtrans %}</dt>
                <dd>{{ route.host }}</dd>
            {% endif %}
            {% if route.condition is not empty %}
                <dt>{% trans %}Condition{% endtrans %}</dt>
                <dd>{{ route.condition }}</dd>
            {% endif %}

        </dl>
        {{ include('@ZikulaRoutesModule/Helper/includeStandardFieldsDisplay.html.twig', {obj: route}) }}
    </div>
{% endblock %}
