XH_Digital_Management/templates/pagination_ps.html

55 lines
3.1 KiB
HTML
Raw Normal View History

<div class="row mb-3 justify-content-end">
<!-- [ 数量统计 ] 开始 -->
<div class="col-sm-12 col-md-5">
2024-05-29 15:40:26 +08:00
<div class="dataTables_info" id="single-select_info" role="status" aria-live="polite">
2024-05-30 17:06:23 +08:00
显示第 {{ page_obj.start_index }} 到第 {{ page_obj.end_index }} 项,共 {{ page_obj.paginator.count }} 项
</div>
</div>
<!-- [ 数量统计 ] 结束 -->
<!-- [ 分页 ] 开始 -->
<div class="col-sm-12 col-md-7">
<div class="dataTables_paginate paging_simple_numbers" id="single-select_paginate">
<ul class="pagination justify-content-end">
2024-05-30 17:06:23 +08:00
<li class="paginate_button page-item {% if not page_obj.has_previous %}disabled{% endif %}">
<a href="?page=1{{ query_params }}" class="page-link">首页</a>
</li>
<li class="paginate_button page-item {% if not page_obj.has_previous %}disabled{% endif %}" id="single-select_previous">
{% if page_obj.has_previous %}
<a href="?page={{ page_obj.previous_page_number }}{{ query_params }}" aria-controls="single-select" tabindex="0" class="page-link">上一页</a>
{% else %}
<span class="page-link">上一页</span>
{% endif %}
</li>
{% with current=page_obj.number max_pages=page_obj.paginator.num_pages %}
{% for num in page_obj.paginator.page_range %}
{% if num >= current|add:"-2" and num <= current|add:"2" %}
<li class="paginate_button page-item {% if num == current %}active{% endif %}">
<a href="?page={{ num }}{{ query_params }}" aria-controls="single-select" tabindex="0" class="page-link">{{ num }}</a>
</li>
{% endif %}
{% endfor %}
{% endwith %}
<li class="paginate_button page-item {% if not page_obj.has_next %}disabled{% endif %}" id="single-select_next">
{% if page_obj.has_next %}
<a href="?page={{ page_obj.next_page_number }}{{ query_params }}" aria-controls="single-select" tabindex="0" class="page-link">下一页</a>
{% else %}
<span class="page-link">下一页</span>
{% endif %}
</li>
{% with max_pages=page_obj.paginator.num_pages %}
<!-- 其他分页代码... -->
<li class="paginate_button page-item {% if not page_obj.has_next %}disabled{% endif %}">
{% if page_obj.has_next %}
<a href="?page={{ max_pages }}{{ query_params }}"
class="page-link">尾页</a>
{% else %}
<span class="page-link">尾页</span>
{% endif %}
2024-05-29 15:40:26 +08:00
</li>
2024-05-30 17:06:23 +08:00
<!-- 其他分页代码... -->
{% endwith %}
</ul>
</div>
</div>
<!-- [ 分页 ] 结束 -->
2024-05-30 17:33:51 +08:00
</div>