vendor/sylius/sylius/src/Sylius/Bundle/UiBundle/Resources/views/Grid/_default.html.twig line 1

Open in your IDE?
  1. {% import '@SyliusUi/Macro/pagination.html.twig' as pagination %}
  2. {% import '@SyliusUi/Macro/buttons.html.twig' as buttons %}
  3. {% import '@SyliusUi/Macro/messages.html.twig' as messages %}
  4. {% import '@SyliusUi/Macro/table.html.twig' as table %}
  5. {% set definition = grid.definition %}
  6. {% set data = grid.data %}
  7. {% set path = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %}
  8. {% set criteria = app.request.query.get('criteria') %}
  9. {% if definition.enabledFilters|length > 0 %}
  10.     <div class="ui hidden divider"></div>
  11.     <div class="ui styled fluid accordion">
  12.         <div class="title {% if criteria is not null %}active{% endif %}">
  13.             <i class="dropdown icon"></i>
  14.             <i class="filter icon"></i>
  15.             {{ 'sylius.ui.filters'|trans }}
  16.         </div>
  17.         <div class="content {% if criteria is not null %}active{% endif %}">
  18.             <form method="get" action="{{ path }}" class="ui loadable form" novalidate>
  19.                 <div class="sylius-filters">
  20.                     {% for filter in definition.enabledFilters|filter(filter => filter.enabled)|sort_by('position') %}
  21.                         <div class="sylius-filters__field">
  22.                             {{ sylius_grid_render_filter(grid, filter) }}
  23.                         </div>
  24.                     {% endfor %}
  25.                 </div>
  26.                 {{ buttons.filter() }}
  27.                 {{ buttons.resetFilters(path) }}
  28.             </form>
  29.         </div>
  30.     </div>
  31. {% endif %}
  32. <div class="ui hidden divider"></div>
  33. <div class="sylius-grid-wrapper">
  34.     <div class="sylius-grid-nav">
  35.         {% if data|length > 0 and definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %}
  36.             <div class="sylius-grid-nav__bulk">
  37.                 {% for action in definition.getEnabledActions('bulk') %}
  38.                     {{ sylius_grid_render_bulk_action(grid, action, null) }}
  39.                 {% endfor %}
  40.             </div>
  41.         {% endif %}
  42.         <div class="sylius-grid-nav__pagination">
  43.             {{ pagination.simple(data) }}
  44.         </div>
  45.         {% if definition.limits|length > 1 and data|length > min(definition.limits) %}
  46.             <div class="sylius-grid-nav__perpage">
  47.                 <div class="ui fluid one menu sylius-paginate">
  48.                     {{ pagination.perPage(data, definition.limits) }}
  49.                 </div>
  50.             </div>
  51.         {% endif %}
  52.     </div>
  53.     {% if data|length > 0 %}
  54.         <div class="ui segment spaceless sylius-grid-table-wrapper">
  55.             <table class="ui sortable stackable very basic celled table" {{ sylius_test_html_attribute('grid-table') }}>
  56.                 <thead>
  57.                 <tr>
  58.                     {{ table.headers(grid, definition, app.request.attributes) }}
  59.                 </tr>
  60.                 </thead>
  61.                 <tbody {{ sylius_test_html_attribute('grid-table-body') }}>
  62.                 {% for row in data %}
  63.                     {{ table.row(grid, definition, row) }}
  64.                 {% endfor %}
  65.                 </tbody>
  66.             </table>
  67.         </div>
  68.     {% else %}
  69.         {{ messages.info('sylius.ui.no_results_to_display') }}
  70.     {% endif %}
  71.     {{ pagination.simple(data) }}
  72. </div>