<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<body>
<!--  <div th:replace="comm/macros::pageNav(${articles},'←','→','page')"></div>-->
<ol class="page-navigator" th:fragment="pageNav(Page4Navigator, prevText, nextText, prefix)">
    <th:block th:if="${Page4Navigator.HasPrevious}">
        <li class="prev"><a th:href="@{'/'+${prefix}+'/'+${Page4Navigator.number}}" th:text="${prevText}"></a></li>
    </th:block>


    <th:block th:each="navIndex :${ Page4Navigator.navigatepageNums}">
        <li th:class="${Page4Navigator.number==navIndex}?'current':''">
            <a th:href="@{'/page/'+${navIndex}}"
               th:text="${navIndex}"></a></li>
    </th:block>

    <th:block th:if="${Page4Navigator.HasNext}">
        <li class="next"><a th:href="@{'/'+${prefix}+'/'+${Page4Navigator.number+2}}" th:text="${nextText}"></a></li>
    </th:block>
</ol>

<div th:fragment="pageAdminNav(Page4Navigator)">
    <div class="clearfix">
        <ul class="pagination m-b-5 pull-right">
            <li th:if="${Page4Navigator.HasPrevious}">
                <a th:href="@{'?page='+${Page4Navigator.number}}" aria-label="Previous">
                    <i class="fa fa-angle-left"></i>&nbsp;上一页
                </a>
            </li>
            <th:block th:each="nav : ${Page4Navigator.navigatepageNums}">
                <li th:class="${nav==Page4Navigator.number+1}?'active':''"><a th:href="@{'?page='+${nav}}" th:text="${nav}"></a>
                </li>
            </th:block>
            <th:block th:if="${Page4Navigator.HasNext}">
                <li>
                    <a th:href="@{'?page='+${Page4Navigator.number+2}}" aria-label="Next">
                        下一页&nbsp;<i class="fa fa-angle-right"></i>
                    </a>
                </li>
            </th:block>

            <li><span th:text="'共'+${Page4Navigator.totalPages}+'页'"></span></li>
        </ul>
    </div>
</div>

</body>
</html>