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