{% extends '@Core/admin/layout.html.twig' %} {% block title %}{{ configuration.pageTitle('index')|trans }} - {{ parent() }}{% endblock %} {% block body %} {% block header %}
{% block header_title %}

{{ configuration.pageTitle('index')|trans }}

{% endblock %} {% block header_actions %}
{% if configuration.action('index', 'new', true) %} {{ configuration.actionTitle('index', 'new', 'New')|trans }} {% endif %} {% if header_actions_dropdown_menu is not defined %} {% set header_actions_dropdown_menu = '' %} {% endif %} {% block header_actions_dropdown %} {% if header_actions_dropdown_menu %} {% endif %} {% endblock %}
{% endblock %}
{% block header_filter_pager %} {% if filters.show %}
{{ knp_pagination_render(pager) }}
{% else %} {{ knp_pagination_render(pager) }} {% endif %} {% endblock %}
{% endblock %} {% block list %} {% set isSortable = configuration.isSortableCollection('index') %}
{% block list_header %} {% for label, config in configuration.fields('index') %} {% set attr = config.options.attr is defined ? config.options.attr : [] %} {% set isSortable = config.options.sort ?? false %} {% endfor %} {% endblock %} {% block list_items %} {% if isSortable %} {% set dataSortable = 'data-sortable' %} {% set dataSortableRoute = 'data-sortable-route="' ~ path( configuration.pageRoute('sort'), { _token: csrf_token('sort'), page: pager.currentPageNumber, context: 'index', } ) ~ '"' %} {% else %} {% set dataSortable = '' %} {% set dataSortableRoute = '' %} {% endif %} {% for item in pager %} {% if isSortable %} {% set dataSortableItem = 'data-sortable-item="' ~ loop.index ~ '"' %} {% else %} {% set dataSortableItem = '' %} {% endif %} {% block list_item %} {%- set dbClick %} {% if configuration.action('index', 'show', true) %} {{ path(configuration.pageRoute('show'), {entity: item.id}) }} {% elseif configuration.action('index', 'edit', true) %} {{ path(configuration.pageRoute('edit'), {entity: item.id}) }} {% endif %} {% endset -%} {% for config in configuration.fields('index') %} {% set attr = config.options.attr is defined ? config.options.attr : [] %} {% set action = config.options.action is defined ? config.options.action : null %} {% endfor %} {% endblock %} {% if loop.last and isSortable %} {% endif %} {% else %} {% endfor %} {% endblock %}
{% if isSortable %} {% if sort %} {% if sort.label == label %} {% if sort.direction == 'asc' %} {% set newDirection = 'desc' %} {% set icon = 'fa fa-sort-amount-down-alt' %} {% else %} {% set newDirection = 'asc' %} {% set icon = 'fa fa-sort-amount-up-alt' %} {% endif %} {% set url = path(configuration.getPageRoute('index'), { _sort: config.options.sort[0], _sort_direction: newDirection, }) %} {% else %} {% set url = path(configuration.getPageRoute('index'), { _sort: config.options.sort[0], _sort_direction: 'asc', }) %} {% set icon = null %} {% endif %} {% if icon is defined %} {% endif %} {{ label|trans }} {% else %} {{ label|trans }} {% endif %} {% else %} {{ label|trans }} {% endif %} {{ 'Actions'|trans }}
{% if action == 'show' %} {{ render_field(item, config, configuration.defaultLocale) }} {% elseif action == 'edit' %} {{ render_field(item, config, configuration.defaultLocale) }} {% else %} {{ render_field(item, config, configuration.defaultLocale) }} {% endif %} {% block list_item_actions_before %}{% endblock %} {% if configuration.action('index', 'show', true) %} {% endif %} {% if configuration.action('index', 'edit', true) %} {% endif %} {% if configuration.action('index', 'delete', true) %}
{% endif %} {% block list_item_actions_after %}{% endblock %}
{{ 'You can sort items by drag & drop'|trans }}
{{ 'No result'|trans }}
{% endblock %} {% endblock %}