minor edits

This commit is contained in:
Zakharov_Rostislav 2024-06-09 20:28:51 +04:00
parent f6e5c71aba
commit 8e14a128ea

View File

@ -3,17 +3,18 @@
<body> <body>
<th:block th:fragment="pagination (url, totalPages, currentPage)"> <th:block th:fragment="pagination (url, totalPages, currentPage, requestParams)">
<nav th:if="${totalPages > 1}" th:with=" <nav th:if="${totalPages > 1}" th:with="
maxPage=2, maxPage=2,
currentPage=${currentPage + 1}"> currentPage=${currentPage + 1}">
<ul class="pagination justify-content-center" <ul class="pagination justify-content-center"
th:with=" th:with="
seqFrom=${currentPage - maxPage < 1 ? 1 : currentPage - maxPage}, seqFrom=${currentPage - maxPage < 1 ? 1 : currentPage - maxPage},
seqTo=${currentPage + maxPage > totalPages ? totalPages : currentPage + maxPage}"> seqTo=${currentPage + maxPage > totalPages ? totalPages : currentPage + maxPage}">
<th:block th:if="${currentPage > maxPage + 1}"> <th:block th:if="${currentPage > maxPage + 1}">
<li class="page-item"> <li class="page-item">
<a class="page-link" aria-label="Previous" th:href="@{/{url}?page=0(url=${url})}"> <a class="page-link" aria-label="Previous"
th:href="@{/{url}?page=0(url=${url})}">
<span aria-hidden="true">&laquo;</span> <span aria-hidden="true">&laquo;</span>
</a> </a>
</li> </li>
@ -25,7 +26,8 @@
</th:block> </th:block>
<li class="page-item" th:each="page : ${#numbers.sequence(seqFrom, seqTo)}" <li class="page-item" th:each="page : ${#numbers.sequence(seqFrom, seqTo)}"
th:classappend="${page == currentPage} ? 'active' : ''"> th:classappend="${page == currentPage} ? 'active' : ''">
<a class=" page-link" th:href="@{/{url}?page={page}(url=${url},page=${page - 1})}"> <a class=" page-link"
th:href="@{/{url}?page={page}(url=${url},page=${page - 1})}">
<span th:text="${page}" /> <span th:text="${page}" />
</a> </a>
</li> </li>