<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">
<body>
<div id="paginator">
    <div class="col-md-12 text-center">
        <div class='pagination pagination-centered'>
            <ul class="pagination">

                <li th:class="${pager.currentPage == 1}? 'disabled' : ''">
                    <span th:if='${pager.currentPage == 1}'>首页</span>
                    <a th:if='${pager.currentPage != 1}' href="#" th:onclick="'gotoPage(1)'">首页</a>
                </li>

                <li th:class="${pager.currentPage != 1}? '' : 'disabled'">
                    <span th:if='${pager.currentPage == 1}'>«</span>
                    <a th:if='${pager.currentPage != 1}'
                       title='上一页' href="#" th:onclick="'gotoPage('+${pager.currentPage - 1}+')'">«</a>
                </li>

                <li th:each="item : ${#numbers.sequence(pager.beginIndex,pager.endIndex)}"
                    th:class="${item == pager.currentPage ? 'active' : '' }">
                    <span th:if='${item == pager.currentPage}' th:text='${item}'>1</span>
                    <a th:if='${item != pager.currentPage}' href="#" th:onclick="'gotoPage('+${item}+')'">
                        <span th:text='${item}'>1</span>
                    </a>
                </li>

                <li th:class="${pager.currentPage != pager.pages}? '' : 'disabled'">
                    <span th:if='${pager.currentPage == pager.pages}'>»</span>
                    <a th:if='${pager.currentPage != pager.pages}'
                        href="#"
                        th:onclick="'gotoPage('+${pager.currentPage + 1}+')'"
                        title='下一页'>»</a>
                </li>

                <li th:class="${pager.currentPage == pager.pages}? 'disabled' : ''">
                    <span th:if='${pager.currentPage == pager.pages}'>Last</span>
                    <a th:if='${pager.currentPage != pager.pages}'
                        th:onclick="'gotoPage('+${pager.pages}+')'"
                        href="#">末页</a>
                </li>

            </ul>
        </div>
    </div>
</div>
</body>
</html>
