mirror of
https://gitlab.com/SIGBUS/nyaa.git
synced 2025-01-26 07:05:13 +00:00
Add rel="prev"/"next" attribs on pagination (#462)
This commit is contained in:
parent
ad5ea6d91e
commit
2b5f9922e9
|
@ -27,7 +27,11 @@
|
||||||
<ul class="pagination{% if size %} pagination-{{size}}{% endif %}"{{kwargs|xmlattr}}>
|
<ul class="pagination{% if size %} pagination-{{size}}{% endif %}"{{kwargs|xmlattr}}>
|
||||||
{# prev and next are only show if a symbol has been passed. #}
|
{# prev and next are only show if a symbol has been passed. #}
|
||||||
{% if prev != None -%}
|
{% if prev != None -%}
|
||||||
<li{% if not pagination.has_prev %} class="disabled"{% endif %}><a href="{{_arg_url_for(endpoint, url_args, p=pagination.prev_num) if pagination.has_prev else '#'}}">{{prev}}</a></li>
|
{% if pagination.has_prev %}
|
||||||
|
<li><a rel="prev" href="{{_arg_url_for(endpoint, url_args, p=pagination.prev_num)}}">{{prev}}</a></li>
|
||||||
|
{% else %}
|
||||||
|
<li class="disabled"><a href="#">{{prev}}</a></li>
|
||||||
|
{% endif %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
|
|
||||||
{%- for page in pagination.iter_pages(left_edge=2, left_current=6, right_current=6, right_edge=0) %}
|
{%- for page in pagination.iter_pages(left_edge=2, left_current=6, right_current=6, right_edge=0) %}
|
||||||
|
@ -43,10 +47,14 @@
|
||||||
{%- endfor %}
|
{%- endfor %}
|
||||||
|
|
||||||
{% if next != None -%}
|
{% if next != None -%}
|
||||||
<li{% if not pagination.has_next %} class="disabled"{% endif %}><a href="{{_arg_url_for(endpoint, url_args, p=pagination.next_num) if pagination.has_next else '#'}}">{{next}}</a></li>
|
{% if pagination.has_next %}
|
||||||
|
<li><a rel="next" href="{{_arg_url_for(endpoint, url_args, p=pagination.next_num)}}">{{next}}</a></li>
|
||||||
|
{% else %}
|
||||||
|
<li class="disabled"><a href="#">{{next}}</a></li>
|
||||||
|
{% endif %}
|
||||||
{%- endif -%}
|
{%- endif -%}
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endwith %}
|
{% endwith %}
|
||||||
{% endmacro %}
|
{% endmacro %}
|
||||||
|
|
Loading…
Reference in a new issue