forked from pvy/nette-visual-paginator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.latte
36 lines (34 loc) · 1.05 KB
/
template.latte
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
{*
* @param Paginator $paginator
* @param array $steps
* @param boolean $ajax
*}
{if $paginator->pageCount > 1}
{var $link = $ajax ? 'showPage!' : 'this'}
<div class="pagination">
<ul>
{if $paginator->isFirst()}
<li class="first"><a>«</a></li>
{else}
<li class="first"><a href="{link this, 'page' => $paginator->page - 1}" n:class="$ajax ? ajax">«</a></li>
{/if}
{foreach $steps as $step}
{if $step == $paginator->page}
<li class="active"><a>{$step}</a></li>
{else}
<li {if $step == ($paginator->page - 1)}class="previous"{/if} {if $step == ($paginator->page + 1)}class="further"{/if}>
<a href="{link this, 'page' => $step}" n:class="$ajax ? ajax">{$step}</a>
</li>
{/if}
{if $iterator->nextValue > $step + 1}
<li class="disabled"><a>…</a></li>
{/if}
{/foreach}
{if $paginator->isLast()}
<li class="last"><a>»</a></li>
{else}
<li class="last"><a href="{link this, 'page' => $paginator->page + 1}" n:class="$ajax ? ajax">»</a></li>
{/if}
</ul>
</div>
{/if}