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 lines
1.1 KiB

- var pageNumbers = [];
- for (var x = 1; x <= pageCount; x++) {
- pageNumbers.push(x);
- }
nav(aria-label="Page navigation")
ul.pagination.pagination-lg.justify-content-center.flex-wrap
li.page-item(class=(pageNumber == 1 ? "disabled" : false))
a.page-link(href=(pageNumber == 1 ? "javascript:void(0)" : paginationUrlFunction(pageNumber - 1)), aria-label="Previous")
span(aria-hidden="true") &laquo;
each x, xIndex in pageNumbers
if (x >= (pageNumber - 4) && x <= (pageNumber + 4) || xIndex == 0 || xIndex == (pageNumbers.length - 1))
li.page-item(class=(x == pageNumber ? "active" : false))
a.page-link(href=(paginationUrlFunction(x))) #{x}
if (x == 1 && pageNumber > 6)
li.page-item.disabled
a.page-link(href="javascript:void(0)") ...
else if (x == (pageCount - 1) && pageNumber < (pageCount - 5))
li.page-item.disabled
a.page-link(href="javascript:void(0)") ...
li.page-item(class=(pageNumber == pageCount ? "disabled" : false))
a.page-link(href=(pageNumber == pageCount ? "javascript:void(0)" : paginationUrlFunction(pageNumber + 1)), aria-label="Next")
span(aria-hidden="true") &raquo;