forked from KnpLabs/KnpPaginatorBundle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
materialize_pagination.html.twig
83 lines (79 loc) · 2.62 KB
/
materialize_pagination.html.twig
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
{#
/**
* @file
* Materialize pagination control implementation.
*
* View that can be used with the pagination module
* from the Materialize CSS
* https://materializecss.com/pagination.html
*
* @author Leonardo Bressan Motyczka <[email protected]>
*/
#}
{% if pageCount > 1 %}
<ul class="pagination">
{% if first is defined and current != first %}
<li class="waves-effect">
<a href="{{ path(route, query|merge({(pageParameterName): first})) }}">
<i class="material-icons">first_page</i>
</a>
</li>
{% else %}
<li class="disabled">
<a href="#!">
<i class="material-icons">first_page</i>
</a>
</li>
{% endif %}
{% if previous is defined %}
<li class="waves-effect">
<a rel="prev" href="{{ path(route, query|merge({(pageParameterName): previous})) }}">
<i class="material-icons">chevron_left</i>
</a>
</li>
{% else %}
<li class="disabled">
<a href="#!">
<i class="material-icons">chevron_left</i>
</a>
</li>
{% endif %}
{% for page in pagesInRange %}
{% if page != current %}
<li class="waves-effect">
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}">{{ page }}</a>
</li>
{% else %}
<li class="active">
<a href="#!">{{ page }}</a>
</li>
{% endif %}
{% endfor %}
{% if next is defined %}
<li class="waves-effect">
<a rel="next" href="{{ path(route, query|merge({(pageParameterName): next})) }}">
<i class="material-icons">chevron_right</i>
</a>
</li>
{% else %}
<li class="disabled">
<a href="#!">
<i class="material-icons">chevron_right</i>
</a>
</li>
{% endif %}
{% if last is defined and current != last %}
<li class="waves-effect">
<a href="{{ path(route, query|merge({(pageParameterName): last})) }}">
<i class="material-icons">last_page</i>
</a>
</li>
{% else %}
<li class="disabled">
<a href="#!">
<i class="material-icons">last_page</i>
</a>
</li>
{% endif %}
</ul>
{% endif %}