新增页码跳转;修复异常;优化效果
This commit is contained in:
@@ -38,14 +38,33 @@
|
||||
</div>
|
||||
|
||||
<th:block th:if="${_posts.totalPages>1}">
|
||||
<div id="pagination">
|
||||
<div class="post-paging" th:if="${_posts.hasNext()}"
|
||||
<div id="pagination">
|
||||
<div class="post-paging"
|
||||
th:with="_page = ${_posts.page+1},_path = ${path +'page/'+_page }">
|
||||
<a th:if="${path == '/archives' and #strings.isEmpty(tag)}"
|
||||
<a th:if="${_posts.hasNext() and path == '/archives' and #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path == '/archives' and not #strings.isEmpty(tag)}"
|
||||
<a th:if="${_posts.hasNext() and path == '/archives' and not #strings.isEmpty(tag)}"
|
||||
th:data="@{/archives(tag=${tag},page=${_page})}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${path != '/archives'}" th:data="${_path}" th:text="${theme.config.base_set.site_page}"></a>
|
||||
<a th:if="${_posts.hasNext() and path != '/archives'}" th:data="${_path}"
|
||||
th:text="${theme.config.base_set.site_page}"></a>
|
||||
<form class="page-jump-form" method="get" th:action="@{${path}}">
|
||||
<span class="page-jump-label">转到</span>
|
||||
<input th:if="${not #strings.isEmpty(tag)}" type="hidden" name="tag" th:value="${tag}" />
|
||||
<span class="page-jump-input-wrap">
|
||||
<button class="page-jump-step page-jump-step-down" type="button"
|
||||
title="减少页码" aria-label="减少页码"><i class="ri-subtract-line"
|
||||
aria-hidden="true"></i></button>
|
||||
<input class="page-jump-input" type="number" name="page" min="1"
|
||||
th:max="${_posts.totalPages}" th:value="${_posts.page}"
|
||||
inputmode="numeric" aria-label="页码" autocomplete="off" required />
|
||||
<button class="page-jump-step page-jump-step-up" type="button"
|
||||
title="增加页码" aria-label="增加页码"><i class="ri-add-line"
|
||||
aria-hidden="true"></i></button>
|
||||
</span>
|
||||
<span class="page-jump-total">/ [[${_posts.totalPages}]]</span>
|
||||
<button class="page-jump-submit" type="submit" title="跳转到指定页"
|
||||
aria-label="跳转到指定页"><i class="ri-arrow-right-line"></i></button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
|
||||
Reference in New Issue
Block a user