2018-08-14 08:55:34 +00:00
|
|
|
<nav class="nextprev">
|
2018-08-14 08:59:12 +00:00
|
|
|
{%- set ns.prev = getstart - getshow -%}
|
|
|
|
{%- if ns.prev == 0 -%}
|
2018-08-14 08:55:34 +00:00
|
|
|
{%- set ns.prev = None -%}
|
|
|
|
{%- endif -%}
|
|
|
|
|
2018-08-14 08:59:12 +00:00
|
|
|
{%- set ns.next = getstart + getshow -%}
|
|
|
|
{%- if ns.next == 0 -%}
|
2018-08-14 08:55:34 +00:00
|
|
|
{%- set ns.next = None -%}
|
|
|
|
{%- endif -%}
|
|
|
|
|
2018-08-14 08:59:12 +00:00
|
|
|
{%- set thispage = (getstart / getshow)|round(0,'floor')|int + 1 -%}
|
|
|
|
{%- set totalpages = (ns.total / getshow)|round(0,'ceil')|int -%}
|
2018-08-14 08:55:34 +00:00
|
|
|
{%- set ns.ellipsis = False -%}
|
|
|
|
|
|
|
|
{% if thispage > 1 %}
|
2018-08-14 09:01:26 +00:00
|
|
|
<span class="first"><a href="{{ url_for(request.endpoint, title=title, year=year, start=None, show=ns.show, **ns.query) }}">« First</a></span>
|
2018-08-14 08:59:12 +00:00
|
|
|
{% if (getstart - getshow) > 1 %}
|
2018-08-14 09:01:26 +00:00
|
|
|
<span class="prev"><a href="{{ url_for(request.endpoint, title=title, year=year, start=ns.prev, show=ns.show, **ns.query) }}">‹ Prev</a></span>
|
2018-08-14 08:55:34 +00:00
|
|
|
{% endif %}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
{% for page in range(1, totalpages+1) %}
|
|
|
|
{% if page < 4 or page > (totalpages+1-4) or (page > (thispage-3) and page < (thispage+3)) %}
|
|
|
|
{%- if page != thispage -%}
|
2018-08-14 09:02:56 +00:00
|
|
|
{% set goto = (page - 1) * getshow %}
|
|
|
|
{%- if goto == 0 -%}
|
|
|
|
{%- set goto = None -%}
|
|
|
|
{%- endif -%}
|
|
|
|
<span class="nav link"><a href="{{ url_for(request.endpoint, title=title, year=year, start=goto, show=ns.show, **ns.query) }}">{{ page }}</a></span>
|
2018-08-14 08:55:34 +00:00
|
|
|
{%- else -%}
|
|
|
|
<span class="nav plain"><strong>{{ page }}</strong></span>
|
|
|
|
{%- endif %}
|
|
|
|
{%- set ns.ellipsis = False -%}
|
|
|
|
{%- else -%}
|
|
|
|
{%- if not ns.ellipsis -%}
|
|
|
|
<span class="nav plain">…</span>
|
|
|
|
{%- endif -%}
|
|
|
|
{%- set ns.ellipsis = True -%}
|
|
|
|
{% endif %}
|
|
|
|
{% endfor %}
|
|
|
|
|
|
|
|
{% if thispage < totalpages %}
|
2018-08-14 08:59:12 +00:00
|
|
|
{% if (getstart + getshow) != (totalpages - 1) * getshow %}
|
2018-08-14 09:01:26 +00:00
|
|
|
<span class="next"><a href="{{ url_for(request.endpoint, title=title, year=year, start=ns.next, show=ns.show, **ns.query) }}">Next ›</a></span>
|
2018-08-14 08:55:34 +00:00
|
|
|
{% endif %}
|
2018-08-14 09:01:26 +00:00
|
|
|
<span class="last"><a href="{{ url_for(request.endpoint, title=title, year=year, start=(totalpages - 1) * getshow, show=ns.show, **ns.query) }}">Last »</a></span>
|
2018-08-14 08:55:34 +00:00
|
|
|
{% endif %}
|
|
|
|
</nav>
|