-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathdata_table.html.twig
More file actions
55 lines (53 loc) · 2.5 KB
/
data_table.html.twig
File metadata and controls
55 lines (53 loc) · 2.5 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
48
49
50
51
52
53
54
55
{% import '@SyliusBootstrapAdminUi/shared/helper/table.html.twig' as table %}
{% import '@SyliusBootstrapAdminUi/shared/helper/pagination.html.twig' as pagination %}
{% set resources = hookable_metadata.context.resources|default(this.resources|default(null)) %}
{% set data = resources.data|default([]) %}
{% set definition = resources.definition|default(null) %}
{% set live = attributes is defined %}
<div {{ attributes }}>
{% 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">
{% for action in definition.getEnabledActions('bulk') %}
{{ sylius_grid_render_bulk_action(resources, action, null) }}
{% endfor %}
</div>
{% endif %}
<div class="ms-auto">
{{ pagination.number_of_results_selector(data, definition.limits, live) }}
</div>
</div>
</div>
<div data-loading>
<div class="sylius-loader">
<img src="{{ asset('bundles/syliusbootstrapadminui/images/loader.svg') }}" alt="Loading"/>
</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, live) }}
</tr>
</thead>
<tbody {{ sylius_test_html_attribute('grid-table-body') }}>
{% for row in resources.data %}
{{ table.row(resources, resources.definition, row, columns) }}
{% endfor %}
</tbody>
</table>
</div>
<div class="card-footer d-flex align-items-center">
<div class="text-muted">
{{ pagination.results_count(data) }}
</div>
<div class="ms-auto">
{{ pagination.simple(data, live) }}
</div>
</div>
</div>
{% endif %}
</div>