{# @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 %}
|
{% 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 entities|filter(e => e.isAccessible)|first.fields ?? [] %}
{% set is_searchable = null == ea.crud.searchFields or field.property in ea.crud.searchFields %}
{% 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' %}
{% if field.isSortable %} {{ field.label|trans|raw }} {% else %} {{ field.label|trans|raw }} {% endif %} | {% endfor %}{{ t('action.entity_actions', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
{% endif %}
{% for field in entity.fields %}
{% set is_searchable = null == ea.crud.searchFields or field.property in ea.crud.searchFields %}
{{ include(field.templatePath, { field: field, entity: entity }, with_context = false) }} | {% endfor %} {% block entity_actions %}{% if entity.actions.count > 0 %} {% if ea.crud.showEntityActionsAsDropdown %} {% else %} {% for action in entity.actions %} {{ include(action.templatePath, { action: action, entity: entity, isIncludedInDropdown: ea.crud.showEntityActionsAsDropdown }, with_context = false) }} {% endfor %} {% endif %} {% endif %} | {% endblock entity_actions %}|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{ t('datagrid.no_results', ea.i18n.translationParameters, 'EasyAdminBundle')|trans }} | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||