{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} {# @var entities \EasyCorp\Bundle\EasyAdminBundle\Collection\EntityCollection #} {# @var paginator \EasyCorp\Bundle\EasyAdminBundle\Orm\EntityPaginator #} {% extends ea.templatePath('layout') %} {% trans_default_domain ea.i18n.translationDomain %} {% block body_id entities|length > 0 ? 'ea-index-' ~ entities|first.name : '' %} {% block body_class 'ea-index' ~ (entities|length > 0 ? ' ea-index-' ~ entities|first.name : '') %} {% set ea_field_assets = ea.crud.fieldAssets(constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Crud::PAGE_INDEX')) %} {% block configured_head_contents %} {{ parent() }} {% for htmlContent in ea_field_assets.headContents %} {{ htmlContent|raw }} {% endfor %} {% endblock %} {% block configured_body_contents %} {{ parent() }} {% for htmlContent in ea_field_assets.bodyContents %} {{ htmlContent|raw }} {% endfor %} {% endblock %} {% block configured_stylesheets %} {{ parent() }} {{ include('@EasyAdmin/includes/_css_assets.html.twig', { assets: ea_field_assets.cssAssets }, with_context = false) }} {{ include('@EasyAdmin/includes/_encore_link_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }} {% endblock %} {% block configured_javascripts %} {{ parent() }} {{ include('@EasyAdmin/includes/_js_assets.html.twig', { assets: ea_field_assets.jsAssets }, with_context = false) }} {{ include('@EasyAdmin/includes/_encore_script_tags.html.twig', { assets: ea_field_assets.webpackEncoreAssets }, with_context = false) }} {% endblock %} {% block content_title %} {%- apply spaceless -%} {% set custom_page_title = ea.crud.customPageTitle('index', null, ea.i18n.translationParameters) %} {{ custom_page_title is null ? ea.crud.defaultPageTitle('index', null, ea.i18n.translationParameters)|trans|raw : custom_page_title|trans|raw }} {%- endapply -%} {% endblock %} {% set has_batch_actions = batch_actions|length > 0 %} {% block page_actions %} {% if filters|length > 0 %}
{% block filters %} {% set applied_filters = ea.request.query.all['filters']|default([])|keys %}
{{ t('filter.title', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }} {% if applied_filters %} ({{ applied_filters|length }}) {% endif %} {% if applied_filters %} {% endif %}
{% endblock filters %}
{% endif %} {% block global_actions %}
{% for action in global_actions %} {{ include(action.templatePath, { action: action }, with_context = false) }} {% endfor %}
{% endblock global_actions %} {% block batch_actions %} {% if has_batch_actions %}
{% for action in batch_actions %} {{ include(action.templatePath, { action: action }, with_context = false) }} {% endfor %}
{% endif %} {% endblock %} {% endblock page_actions %} {% block main %} {# sort can be multiple; let's consider the sorting field the first one #} {% set sort_field_name = app.request.get('sort')|keys|first %} {% set sort_order = app.request.get('sort')|first %} {# {% set some_results_are_hidden = entities|reduce((some_results_are_hidden, entity) => some_results_are_hidden or not entity.isAccessible, false) %} #} {% set has_footer = entities|length != 0 %} {% set has_search = ea.crud.isSearchEnabled %} {% set has_filters = filters|length > 0 %} {% set num_results = entities|length %} {% if num_results > 0 %} {% block table_head %} {% if has_batch_actions %} {% endif %} {% set ea_sort_asc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::ASC') %} {% set ea_sort_desc = constant('EasyCorp\\Bundle\\EasyAdminBundle\\Config\\Option\\SortOrder::DESC') %} {% endblock table_head %} {% endif %} {% block table_footer %}{% endblock table_footer %}
{{ t('action.entity_actions', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }}
{% block delete_form %} {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', with_context = false) }} {% endblock delete_form %} {% if has_filters %} {{ include('@EasyAdmin/crud/includes/_filters_modal.html.twig') }} {% endif %} {% if has_batch_actions %} {{ include('@EasyAdmin/crud/includes/_batch_action_modal.html.twig', {}, with_context = false) }} {% endif %} {% endblock main %}