1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| <!DOCTYPE html SYSTEM "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-4.dtd"> <html xmlns:th="http://www.thymeleaf.org" lang="zh"> <nav th:fragment="pagination" class="fixed-bottom mx-4" aria-label="Page Navigation" th:if="${page != null && page.totalPages gt 0}" th:with="queryString=${#httpServletRequest.getQueryString()}"> <ul th:if="${page.totalPages le 7}" class="pagination justify-content-end"> <li class="page-item" th:classappend="${page.number eq 0} ? 'disabled' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, page.number - 1, page.size)}" aria-label="Previous"><span aria-hidden="true">«</span></a> </li> <li class="page-item" th:each="i : ${#numbers.sequence(0, page.totalPages - 1)}" th:classappend="${page.number eq i} ? 'active' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, i, page.size)}" th:text="${i + 1}"></a> </li> <li class="page-item" th:classappend="${(page.number + 1) eq page.totalPages} ? 'disabled' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, page.number + 1, page.size)}" aria-label="Next"><span aria-hidden="true">»</span></a> </li> <li class="page-item disabled"> <a class="page-link"> <span aria-hidden="true" th:text="|共(${page.totalElements})条|"></span> </a> </li> </ul> <ul th:if="${page.totalPages gt 7}" class="pagination justify-content-end"> <li class="page-item" th:classappend="${page.number eq 0} ? 'disabled' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, page.number - 1, page.size)}" aria-label="Previous"><span aria-hidden="true">«</span></a> </li> <li class="page-item" th:classappend="${page.number eq 0} ? 'active' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, 0, page.size)}">1</a> </li> <li class="page-item" th:if="${(page.number + 1) > 4}"> <a class="page-link" href="javascript:void(0);" aria-label="···"> <span aria-hidden="true">···</span> </a> </li> <li class="page-item" th:each="i:${#numbers.sequence(1, page.totalPages - 2)}" th:if="${i >= (page.number - 2) and i <= (page.number + 2)}" th:classappend="${page.number eq i} ? 'active' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, i, page.size)}"> <span th:text="${i + 1}"></span> </a> </li> <li class="page-item" th:if="${(page.number + 1) < page.totalPages - 3}"> <a class="page-link" href="javascript:void(0);" aria-label="···"> <span aria-hidden="true">···</span> </a> </li> <li class="page-item" th:classappend="${page.number eq (page.totalPages - 1)} ? 'active' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, page.totalPages - 1, page.size)}" th:text="${page.totalPages}">latest</a> </li> <li class="page-item" th:classappend="${page.number eq (page.totalPages - 1)} ? 'disabled' : ''"> <a class="page-link" th:href="${@pagination.link(queryString, page.number + 1, page.size)}" aria-label="Next"><span aria-hidden="true">»</span></a> </li> <li class="page-item disabled"> <a class="page-link"> <span aria-hidden="true" th:text="|共(${page.totalElements})条|"></span> </a> </li> </ul> </nav>
</html>
|