验证中...
Languages: HTML
Categories: Web开发技术
Latest update 2019-03-12 22:31
articles_pagination.html
Raw Copy
<nav>
<ul class="pagination">
{% if page.has_other_pages %}
<li>
{% if page.has_previous %}
<a href="?{% if is_query_result %}q={{ query }}&amp;{% endif %}page={{ page.previous_page_number }}"
aria-label="Previous">
<span aria-hidden="true">&laquo;</span>
</a>
{% endif %}
</li>
{% for page_num in page.paginator.page_range %}
{% if page.number > 4 %}
{% if page_num > page.number|add:"-4" %}
{% if page_num < page.number|add:"3" %}
<li class="
{% if page_num == page.number %}
active{% endif %}">
<a href="?{% if is_query_result %}q={{ query }}&amp;{% endif %}page={{ page_num }}">
{{ page_num }}<span class="sr-only">(current)</span>
</a>
</li>
{% endif %}
{% endif %}
{% elif page_num < 7 %}
<li class="{% if page_num == page.number %}active{% endif %}">
<a href="?{% if is_query_result %}q={{ query }}&amp;{% endif %}page={{ page_num }}">
{{ page_num }}<span class="sr-only">(current)</span>
</a>
</li>
{% endif %}
{% endfor %}
<li>
{% if page.has_next %}
<a href="?{% if is_query_result %}q={{ query }}&amp;{% endif %}page={{ page.next_page_number }}" aria-label="Next">
<span aria-hidden="true">&raquo;</span>
</a>
{% endif %}
</li>
{% endif %}
</ul>
</nav>

Comment list( 0 )

Sign in for post a comment

Help Search