Skip to content
This repository was archived by the owner on Jun 10, 2022. It is now read-only.

Commit 221ca6f

Browse files
committed
Added grid block overrides
1 parent a7509fc commit 221ca6f

File tree

1 file changed

+97
-0
lines changed

1 file changed

+97
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
{#
2+
#
3+
# This file is part of the CSDataGridBundle package.
4+
#
5+
# (c) Pierre du Plessis <[email protected]>
6+
#
7+
# For the full copyright and license information, please view the LICENSE
8+
# file that was distributed with this source code.
9+
#}
10+
11+
{% extends 'APYDataGridBundle::blocks_js.jquery.html.twig' %}
12+
13+
{# Remove the filters in the grid #}
14+
{% block grid_filters %}{% endblock %}
15+
16+
{# ------------------------------------------------------ grid ------------------------------------------------------ #}
17+
{% block grid %}
18+
<div class="grid">
19+
{% if grid.totalCount > 0 or grid.isFiltered or grid.noDataMessage is sameas(false) %}
20+
<form id="{{ grid.hash }}" action="{{ grid.routeUrl }}" method="post">
21+
22+
<div class="grid_header">
23+
{% if grid.massActions|length > 0 %}
24+
{{ grid_actions(grid) }}
25+
{% endif %}
26+
</div>
27+
28+
<div class="grid_body">
29+
<table class="table table-bordered table-striped table-hover">
30+
{% if grid.isTitleSectionVisible %}
31+
{{ grid_titles(grid) }}
32+
{% endif %}
33+
34+
{% if grid.isFilterSectionVisible %}
35+
{{ grid_filters(grid) }}
36+
{% endif %}
37+
38+
{{ grid_rows(grid) }}
39+
</table>
40+
</div>
41+
42+
<div class="grid_footer">
43+
{% if grid.isPagerSectionVisible %}
44+
{{ grid_pager(grid) }}
45+
{% endif %}
46+
47+
{% if grid.exports|length > 0 %}
48+
{{ grid_exports(grid) }}
49+
{% endif %}
50+
51+
{% if grid.tweaks|length > 0 %}
52+
{{ grid_tweaks(grid) }}
53+
{% endif %}
54+
</div>
55+
56+
{% if withjs %}
57+
{{ grid_scripts(grid) }}
58+
{% endif %}
59+
60+
</form>
61+
{% else %}
62+
{{ grid_no_data(grid) }}
63+
{% endif %}
64+
</div>
65+
{% endblock grid %}
66+
67+
{# -------------------------------------------------- grid_search -------------------------------------------------- #}
68+
{% block grid_search %}
69+
{% if grid.isFilterSectionVisible %}
70+
<div class="grid-search" id="{{ grid.hash }}_grid_search">
71+
<form id="{{ grid.hash }}_search" action="{{ grid.routeUrl }}" method="post" class="form-inline">
72+
73+
<div class="control-group">
74+
{% for column in grid.columns %}
75+
{% if column.visible(true) and column.isFilterable %}
76+
{% set columnTitle = grid.prefixTitle ~ column.title %}
77+
{% if column.filterable %}
78+
<div class="{{ cycle(['odd', 'even'], loop.index) }}">
79+
<div class="controls">
80+
<label class="control-label">{{ columnTitle|trans }}</label>
81+
82+
83+
{{ grid_filter(column, grid, false)|raw }}
84+
</div>
85+
</div>
86+
{% endif %}
87+
{% endif %}
88+
{% endfor %}
89+
90+
<div class="grid-search-action">
91+
<a href="#" class="grid-search-submit btn btn-primary" onclick="$('#{{ grid.hash }}_search').submit()"><i class="icon-search"></i> {{ 'Search'|trans }}</a>
92+
<input type="button" class="grid-search-reset btn" value="{{ 'Reset'|trans }}" onclick="return {{ grid.hash }}_reset();"/>
93+
</div>
94+
</form>
95+
</div>
96+
{% endif %}
97+
{% endblock grid_search %}

0 commit comments

Comments
 (0)