Update pagination api.
This commit is contained in:
parent
191f1c1930
commit
3e34e72931
5 changed files with 13 additions and 13 deletions
|
|
@ -9,19 +9,19 @@
|
|||
|
||||
{% set pagination_slider = 3 %}
|
||||
|
||||
{% if (page.total_pages > 1) %}
|
||||
{% if (page.last > 1) %}
|
||||
|
||||
<ul class="pagination">
|
||||
|
||||
{% if page.current !== page.before %}
|
||||
{% if page.current !== page.previous %}
|
||||
<li>
|
||||
<a href="{{ pagination_url ~ page.before }}">
|
||||
<a href="{{ pagination_url ~ page.previous }}">
|
||||
{{ icon('solid/arrow-left') }} Previous
|
||||
</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% if page.total_pages > pagination_slider and page.current > (pagination_slider + 1) %}
|
||||
{% if page.last > pagination_slider and page.current > (pagination_slider + 1) %}
|
||||
<li>
|
||||
<a href="{{ pagination_url ~ 1 }}">1</a>
|
||||
</li>
|
||||
|
|
@ -30,7 +30,7 @@
|
|||
</li>
|
||||
{% endif %}
|
||||
|
||||
{% for n in max(page.current - pagination_slider, 1)..min(page.current + pagination_slider, page.total_pages) %}
|
||||
{% for n in max(page.current - pagination_slider, 1)..min(page.current + pagination_slider, page.last) %}
|
||||
{% if (n == page.current) %}
|
||||
<li class="active">
|
||||
{% else %}
|
||||
|
|
@ -40,12 +40,12 @@
|
|||
</li>
|
||||
{% endfor %}
|
||||
|
||||
{% if page.total_pages > pagination_slider and page.current < page.total_pages - pagination_slider %}
|
||||
{% if page.last > pagination_slider and page.current < page.last - pagination_slider %}
|
||||
<li class="middle">
|
||||
...
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ pagination_url ~ page.total_pages }}">{{ page.total_pages }}</a>
|
||||
<a href="{{ pagination_url ~ page.last }}">{{ page.last }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
|
||||
|
|
|
|||
Reference in a new issue