2023-03-24 20:25:04 +08:00
|
|
|
<div xmlns:th="https://www.thymeleaf.org"
|
|
|
|
th:fragment="pagination (data, path)"
|
|
|
|
th:if="${data.totalPages > 1}"
|
|
|
|
class="card card-transparent">
|
|
|
|
<nav class="pagination" role="navigation" aria-label="pagination">
|
|
|
|
<a th:href="${data.prevUrl}"
|
|
|
|
th:class="'pagination-previous' + ${data.hasPrevious()?'':' is-invisible is-hidden-mobile'}">上一页</a>
|
|
|
|
<a th:href="${data.nextUrl}"
|
|
|
|
th:class="'pagination-next' + ${data.hasNext()?'':' is-invisible is-hidden-mobile'}">下一页</a>
|
|
|
|
<ul class="pagination-list is-hidden-mobile"
|
|
|
|
th:with="p=${T(java.lang.Math).ceil(T(java.lang.Double).parseDouble(data.page) / 5.0) },start = ${(p * 5) - 5 +1 }, end=${p * 5}">
|
2023-03-22 10:08:39 +08:00
|
|
|
|
2023-03-24 20:25:04 +08:00
|
|
|
<li><a
|
|
|
|
th:each="index : ${#numbers.sequence(start, (data.totalPages > 5) ? end : data.totalPages)}"
|
|
|
|
th:class="'pagination-link' + ${data.page == index ? ' is-current': ''}"
|
|
|
|
th:href="@{${path+'/page/'} + ${index}}" th:text="${index}"></a></li>
|
|
|
|
</ul>
|
|
|
|
</nav>
|
|
|
|
</div>
|