-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from VincentLoy/master
add Foundation 5 Sliding pagination control implementation template
- Loading branch information
Showing
2 changed files
with
99 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
98 changes: 98 additions & 0 deletions
98
Resources/views/Pagination/foundation_v5_pagination.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
{# | ||
/** | ||
* @file | ||
* Foundation 5 Sliding pagination control implementation. | ||
* | ||
* View that can be used with the pagination module | ||
* from the Foundation 5 CSS Toolkit | ||
* http://foundation.zurb.com/docs/components/pagination.html | ||
* | ||
* @author Vincent Loy <[email protected]> | ||
* | ||
* This view have been ported from twitter bootstrap v3 pagination control implementation | ||
* from : | ||
* @author Pablo Díez <[email protected]> | ||
* @author Jan Sorgalla <[email protected]> | ||
* @author Artem Ponomarenko <[email protected]> | ||
* @author Artem Zabelin <[email protected]> | ||
*/ | ||
#} | ||
|
||
{% if pageCount > 1 %} | ||
<ul class="pagination"> | ||
{% if previous is defined %} | ||
<li class="arrow"> | ||
<a href="{{ path(route, query|merge({(pageParameterName): previous})) }}">« {{ 'Previous'|trans }}</a> | ||
</li> | ||
{% else %} | ||
<li class="arrow unavailable"> | ||
<a> | ||
« {{ 'Previous'|trans }} | ||
</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% if startPage > 1 %} | ||
<li> | ||
<a href="{{ path(route, query|merge({(pageParameterName): 1})) }}">1</a> | ||
</li> | ||
{% if startPage == 3 %} | ||
<li> | ||
<a href="{{ path(route, query|merge({(pageParameterName): 2})) }}">2</a> | ||
</li> | ||
{% elseif startPage != 2 %} | ||
<li class="unavailable"> | ||
<a>…</a> | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
|
||
{% for page in pagesInRange %} | ||
{% if page != current %} | ||
<li> | ||
<a href="{{ path(route, query|merge({(pageParameterName): page})) }}"> | ||
{{ page }} | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="current"> | ||
<a>{{ page }}</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% endfor %} | ||
|
||
{% if pageCount > endPage %} | ||
{% if pageCount > (endPage + 1) %} | ||
{% if pageCount > (endPage + 2) %} | ||
<li class="unavailable"> | ||
<a>…</a> | ||
</li> | ||
{% else %} | ||
<li> | ||
<a href="{{ path(route, query|merge({(pageParameterName): (pageCount - 1)})) }}"> | ||
{{ pageCount -1 }} | ||
</a> | ||
</li> | ||
{% endif %} | ||
{% endif %} | ||
<li> | ||
<a href="{{ path(route, query|merge({(pageParameterName): pageCount})) }}">{{ pageCount }}</a> | ||
</li> | ||
{% endif %} | ||
|
||
{% if next is defined %} | ||
<li class="arrow"> | ||
<a href="{{ path(route, query|merge({(pageParameterName): next})) }}"> | ||
{{ 'Next'|trans }} » | ||
</a> | ||
</li> | ||
{% else %} | ||
<li class="arrow unavailable"> | ||
<a> | ||
{{ 'Next'|trans }} » | ||
</a> | ||
</li> | ||
{% endif %} | ||
</ul> | ||
{% endif %} |