templates/content/page/crud/index.html.twig line 1

Open in your IDE?
  1. {# @var ea \EasyCorp\Bundle\EasyAdminBundle\Context\AdminContext #}
  2. {# @var entities \EasyCorp\Bundle\EasyAdminBundle\Collection\EntityDtoCollection #}
  3. {# @var paginator \EasyCorp\Bundle\EasyAdminBundle\Orm\EntityPaginator #}
  4. {% extends ea.templatePath('layout') %}
  5. {% trans_default_domain ea.i18n.translationDomain %}
  6. {% block body_id entities|length > 0 ? 'ea-index-' ~ entities|first.name : '' %}
  7. {% block body_class 'ea-index' ~ (entities|length > 0 ? ' ea-index-' ~ entities|first.name : '') %}
  8.     {% block content_title %}
  9.     {%- apply spaceless -%}
  10.     {% set custom_page_title = ea.crud.customPageTitle('index') %}
  11.     {{ custom_page_title is null
  12.             ? (ea.crud.defaultPageTitle('index')|trans(ea.i18n.translationParameters, 'EasyAdminBundle'))|raw
  13.             : (custom_page_title|trans(ea.i18n.translationParameters))|raw }}
  14. {%- endapply -%}
  15. {% endblock %}
  16. {% set has_batch_actions = batch_actions|length > 0 %}
  17.     {% block page_actions %}
  18.         {% if filters|length > 0 %}
  19.             <div class="datagrid-filters"> {% block filters %}
  20.                 {% set applied_filters = ea.request.query.all['filters']|default([])|keys %}
  21.                 <div class="btn-group action-filters">
  22.                     <a href="#" data-href="{{ ea_url().setAction('renderFilters').includeReferrer() }}" class="btn btn-secondary btn-labeled btn-labeled-right action-filters-button disabled {{ applied_filters ? 'action-filters-applied' }}" data-bs-toggle="modal" data-bs-target="#modal-filters">
  23.                         <i class="fa fa-filter fa-fw"></i>
  24.                         {{ 'filter.title'|trans(ea.i18n.translationParameters, 'EasyAdminBundle') }}
  25.                         {% if applied_filters %}
  26.                             <span class="text-primary">({{ applied_filters|length }})</span>
  27.                         {% endif %}
  28.                     </a>
  29.                     {% if applied_filters %}
  30.                         <a href="{{ ea_url().unset('filters') }}" class="btn btn-secondary action-filters-reset">
  31.                             <i class="fa fa-close"></i>
  32.                         </a>
  33.                     {% endif %}
  34.                 </div>
  35.             {% endblock filters %}
  36.         </div>
  37.     {% endif %}
  38.     {% block global_actions %}
  39.         <div class="global-actions">
  40.             {% for action in global_actions %}
  41.                 {{ include(action.templatePath, { action: action }, with_context = false) }}
  42.             {% endfor %}
  43.         </div>
  44.     {% endblock global_actions %}
  45.     {% block batch_actions %}
  46.         {% if has_batch_actions %}
  47.             <div class="batch-actions" style="display: none">
  48.                 {% for action in batch_actions %}
  49.                     {{ include(action.templatePath, { action: action }, with_context = false) }}
  50.                 {% endfor %}
  51.             </div>
  52.         {% endif %}
  53.     {% endblock %}
  54. {% endblock page_actions %}
  55. {% block main %}
  56.     {{ flasher_render() }}
  57.     {# sort can be multiple; let's consider the sorting field the first one #}
  58.     {% set sort_field_name = app.request.get('sort')|keys|first %}
  59.     {% set sort_order = app.request.get('sort')|first %}
  60.     {% set some_results_are_hidden = false %}
  61.     {% set has_footer = entities|length != 0 %}
  62.     {% set has_search = ea.crud.isSearchEnabled %}
  63.     {% set has_filters = filters|length > 0 %}
  64.     {% set num_results = entities|length %}
  65.     {% include "content/page/crud/import-index.html.twig" %}
  66.     <ul class="nav nav-tabs" id="myTab" role="tablist">
  67.         <li class="nav-item" role="presentation">
  68.             <button class="nav-link active" id="menu-tab" data-bs-toggle="tab" data-bs-target="#menu-tab-pane" type="button" role="tab" aria-controls="menu-tab-pane" aria-selected="true">Menu 1</button>
  69.         </li>
  70.         <li class="nav-item" role="presentation">
  71.             <button class="nav-link" id="smenu-tab" data-bs-toggle="tab" data-bs-target="#smenu-tab-pane" type="button" role="tab" aria-controls="smenu-tab-pane" aria-selected="false">Menu 2</button>
  72.         </li>
  73.         <li class="nav-item" role="presentation">
  74.             <button class="nav-link" id="smenu-tab3" data-bs-toggle="tab" data-bs-target="#smenu-tab-pane3" type="button" role="tab" aria-controls="smenu-tab-pane3" aria-selected="false">Menu 3</button>
  75.         </li>
  76.         <li class="nav-item" role="presentation">
  77.             <button class="nav-link" id="smenu-tab4" data-bs-toggle="tab" data-bs-target="#smenu-tab-pane4" type="button" role="tab" aria-controls="smenu-tab-pane4" aria-selected="false">Menu 4</button>
  78.         </li>
  79.     </ul>
  80.     <div class="tab-content" id="myTabContent">
  81.         <div class="tab-pane fade show active" id="menu-tab-pane" role="tabpanel" aria-labelledby="menu-tab" tabindex="0">
  82.             {% set originEntity = entities %}
  83.             {% if prentChild(entities, '1') %}
  84.                 {% set entities = prentChild(entities, '1') %}
  85.                 {% set has_footer = entities|length != 0 %}
  86.                 {% set num_results = entities|length %}
  87.                 {% include "content/page/crud/index-code.html.twig" %}
  88.             {% endif %}
  89.             {% set entities = originEntity %}
  90.             {% set has_footer = entities|length != 0 %}
  91.             {% set num_results = entities|length %}
  92.         </div>
  93.         <div class="tab-pane fade" id="smenu-tab-pane" role="tabpanel" aria-labelledby="smenu-tab" tabindex="0">
  94.             {% if prentChild(entities, '2') %}
  95.                 {% set entities = prentChild(entities, '2') %}
  96.                 {% set has_footer = entities|length != 0 %}
  97.                 {% set num_results = entities|length %}
  98.                 {% include "content/page/crud/index-code.html.twig" %}
  99.             {% endif %}
  100.             {% set entities = originEntity %}
  101.             {% set has_footer = entities|length != 0 %}
  102.             {% set num_results = entities|length %}
  103.         </div>
  104.         <div class="tab-pane fade" id="smenu-tab-pane3" role="tabpanel" aria-labelledby="smenu-tab3" tabindex="0">
  105.             {% if prentChild(entities, '3') %}
  106.                 {% set entities = prentChild(entities, '3') %}
  107.                 {% set has_footer = entities|length != 0 %}
  108.                 {% set num_results = entities|length %}
  109.                 {% include "content/page/crud/index-code.html.twig" %}
  110.             {% endif %}
  111.             {% set entities = originEntity %}
  112.             {% set has_footer = entities|length != 0 %}
  113.             {% set num_results = entities|length %}
  114.         </div>
  115.         <div class="tab-pane fade" id="smenu-tab-pane4" role="tabpanel" aria-labelledby="smenu-tab4" tabindex="0">
  116.             {% if prentChild(entities, '4') %}
  117.                 {% set entities = prentChild(entities, '4') %}
  118.                 {% set has_footer = entities|length != 0 %}
  119.                 {% set num_results = entities|length %}
  120.                 {% include "content/page/crud/index-code.html.twig" %}
  121.             {% endif %}
  122.             {% set entities = originEntity %}
  123.             {% set has_footer = entities|length != 0 %}
  124.             {% set num_results = entities|length %}
  125.         </div>
  126.     </div>
  127.     {% block delete_form %}
  128.         {{ include('@EasyAdmin/crud/includes/_delete_form.html.twig', with_context = false) }}
  129.     {% endblock delete_form %}
  130.     {% if has_filters %}
  131.         {{ include('@EasyAdmin/crud/includes/_filters_modal.html.twig') }}
  132.     {% endif %}
  133.     {% if has_batch_actions %}
  134.         {{ include('@EasyAdmin/crud/includes/_batch_action_modal.html.twig', {}, with_context = false) }}
  135.     {% endif %}
  136. {% endblock main %}