You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

26 line
1.2KB

  1. - var pageNumbers = [];
  2. - for (var x = 1; x <= pageCount; x++) {
  3. - pageNumbers.push(x);
  4. - }
  5. nav(aria-label="Page navigation")
  6. ul(class="pagination pagination-lg justify-content-center")
  7. li(class="page-item", class=(pageNumber == 1 ? "disabled" : false))
  8. a(class="page-link", href=(pageNumber == 1 ? "javascript:void(0)" : paginationUrlFunction(pageNumber - 1)), aria-label="Previous")
  9. span(aria-hidden="true") &laquo;
  10. each x, xIndex in pageNumbers
  11. if (x >= (pageNumber - 4) && x <= (pageNumber + 4) || xIndex == 0 || xIndex == (pageNumbers.length - 1))
  12. li(class="page-item", class=(x == pageNumber ? "active" : false))
  13. a(class="page-link", href=(paginationUrlFunction(x))) #{x}
  14. if (x == 1 && pageNumber > 6)
  15. li(class="page-item disabled")
  16. a(class="page-link", href="javascript:void(0)") ...
  17. else if (x == (pageCount - 1) && pageNumber < (pageCount - 5))
  18. li(class="page-item disabled")
  19. a(class="page-link", href="javascript:void(0)") ...
  20. li(class="page-item", class=(pageNumber == pageCount ? "disabled" : false))
  21. a(class="page-link", href=(pageNumber == pageCount ? "javascript:void(0)" : paginationUrlFunction(pageNumber + 1)), aria-label="Next")
  22. span(aria-hidden="true") &raquo;