A web application allowing people to create an account, configure a profile, and share a list of URLs on that profile.
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.
 
 
 
 

27 lines
1.0 KiB

mixin renderPaginationBar (baseUrl, totalItemCount, urlParameters = '')
-
var startPage = pagination.p - 2;
if (startPage < 1) {
startPage = 1;
}
var endPage = startPage + 4;
var lastPage = Math.floor(totalItemCount / pagination.cpp);
if ((totalItemCount % pagination.cpp) !== 0) {
++lastPage;
}
if (endPage > lastPage) {
endPage = lastPage;
}
ul(aria-label="Page navigation").uk-pagination.uk-flex-center
li(class= pagination.p === 1 ? 'uk-disabled' : undefined)
a(href=`${baseUrl}?p=${pagination.p - 1}${urlParameters}`)
span(uk-pagination-previous).uk-margin-small-right
span prev
while startPage <= endPage
li(class= startPage === pagination.p ? 'active' : undefined)
a(href=`${baseUrl}?p=${startPage}${urlParameters}`)= startPage++
li(class= pagination.p === lastPage ? 'disabled' : undefined)
a(href=`${baseUrl}?p=${pagination.p + 1}${urlParameters}`)
span next
span(uk-pagination-next).uk-margin-small-left