forked from Sylius/Stack
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_table.html.twig
More file actions
47 lines (45 loc) · 2.07 KB
/
data_table.html.twig
File metadata and controls
47 lines (45 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
{% import '@SyliusBootstrapAdminUi/shared/helper/table.html.twig' as table %}
{% import '@SyliusBootstrapAdminUi/shared/helper/pagination.html.twig' as pagination %}
{% set resources = resources|default(hookable_metadata.context.resources|default(null)) %}
{% set data = resources.data|default([]) %}
{% set definition = resources.definition|default(null) %}
{% if data|length > 0 %}
<div class="card">
<div class="card-body border-bottom py-3">
<div class="d-flex">
{% if data|length > 0 and definition.actionGroups.bulk is defined and definition.getEnabledActions('bulk')|length > 0 %}
<div class="sylius-grid-nav__bulk grid">
{% for action in definition.getEnabledActions('bulk')|sylius_sort_by('position') %}
{{ sylius_grid_render_bulk_action(resources, action, null) }}
{% endfor %}
</div>
{% endif %}
<div class="ms-auto">
{{ pagination.number_of_results_selector(data, definition.limits) }}
</div>
</div>
</div>
<div class="table-responsive">
<table class="table card-table table-vcenter datatable" {{ sylius_test_html_attribute('grid-table') }}>
<thead>
<tr>
{{ table.headers(resources, resources.definition, app.request.attributes) }}
</tr>
</thead>
<tbody {{ sylius_test_html_attribute('grid-table-body') }}>
{% for row in resources.data %}
{{ table.row(resources, resources.definition, row) }}
{% endfor %}
</tbody>
</table>
</div>
<div class="card-footer d-flex align-items-center gap-2 flex-wrap">
<div class="text-muted">
{{ pagination.results_count(data) }}
</div>
<div class="ms-auto">
{{ pagination.simple(data) }}
</div>
</div>
</div>
{% endif %}