{# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #} {# @var entities \EasyCorp\Bundle\EasyAdminBundle\Collection\EntityDtoCollection #} {# @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 'index' ~ (entities|length > 0 ? ' index-' ~ entities|first.name : '') %} {% block content_title %} {{ 'index'|sov_trans_admin_title(translation_entity_name) }} {% endblock %} {% block content_breadcrumb %} {{ include('@LcSov/adminlte/block/breadcrumb.html.twig') }} {% endblock content_breadcrumb %} {% set has_batch_actions = batch_actions|length > 0 %} {% block page_actions %} {% endblock page_actions %} {% block main %} {% block main_prepend %}{% endblock %} {% set _block_index_id = block('index_id') %}
{# 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 = false %} {% set has_footer = entities|length != 0 %} {% set has_search = ea.crud.isSearchEnabled %} {% set has_filters = filters|length > 0 %} {% set has_datagrid_tools = has_search or has_filters %} {% block card_wrapper %}
{% block card_header_wrapper %}
{{ paginator.numResults }} résultats
{% 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 %} {% endif %} {% endblock %}
{% endblock %} {% block card_body_wrapper %}
{% 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') %} {% for field in fields ?? [] %} {% set field = field.getAsDto() %} {% if field.isDisplayedOn('index') %} {% set is_sorting_field = ea.search.isSortingField(field.property) %} {% set next_sort_direction = is_sorting_field ? (ea.search.sortDirection(field.property) == ea_sort_desc ? ea_sort_asc : ea_sort_desc) : ea_sort_desc %} {% set column_icon = is_sorting_field ? (next_sort_direction == ea_sort_desc ? 'fa-arrow-up' : 'fa-arrow-down') : 'fa-sort' %} {% endif %} {% endfor %} {% endblock table_head %} {% block table_filters %} {{ include('@LcSov/adminlte/block/table_filters.html.twig') }} {% endblock table_filters %} {% block table_body %} {% for entity in entities %} {% if not entity.isAccessible %} {% set some_results_are_hidden = true %} {% else %} {% if has_batch_actions %} {% endif %} {% for field in entity.fields %} {% endfor %} {% block entity_actions %} {% endblock entity_actions %} {% endif %} {% else %} {% endfor %} {% if some_results_are_hidden %} {% endif %} {% endblock table_body %}
{% if field.isSortable %} {% if field.label is not null %} {{ field.label|raw }} {% else %} {{ field.getProperty|sov_trans_admin_field_index(translation_entity_name) }} {% endif %} {% else %} {% if field.label is not null %} {{ field.label|raw }} {% else %} {{ field.getProperty|sov_trans_admin_field_index(translation_entity_name) }} {% endif %} {% endif %} {{ 'action.entity_actions'|trans(ea.i18n.translationParameters, 'EasyAdminBundle') }}
{{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }} {% if entity.actions.count > 0 %} {% set has_dropdown = false %} {% set in_dropdown_class = 'in-dropdown' %} {% for action in entity.actions %} {% if not (in_dropdown_class in action.cssClass) %} {{ include(action.templatePath, { action: action, entity: entity, isIncludedInDropdown: 0 }, with_context = false) }} {% else %} {% set has_dropdown = true %} {% endif %} {% endfor %} {% if has_dropdown %} {% endif %} {% endif %} {% if not ea.crud.showEntityActionsAsDropdown %} {% else %} {% endif %}
{{ 'datagrid.no_results'|trans(ea.i18n.translationParameters, 'EasyAdminBundle') }}
{{ 'datagrid.hidden_results'|trans({}, 'EasyAdminBundle') }}
{% block filters_form %} {% if filters_form is defined %} {{ form_start(filters_form, {'attr' :{'id' : 'filters-form'}}) }} {# #} {{ form_end(filters_form) }} {% endif %} {% endblock filters_form %}
{% endblock %} {% block card_footer_wrapper %} {% endblock %} {% 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 card_wrapper %} {% block main_append %}{% endblock %} {% endblock main %} {% block body_javascript %} {{ parent() }} {% if app.request.get('query') is not empty %} {% endif %} {% endblock %}