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.

blocks.pug 1.1KB

3 anni fa
1234567891011121314151617181920212223242526272829303132333435
  1. extends layout
  2. block content
  3. h1(class="h2") Blocks
  4. hr
  5. if (blocks)
  6. nav(aria-label="Page navigation")
  7. ul(class="pagination justify-content-center")
  8. li(class="page-item", class=(sort == "asc" ? "active" : false))
  9. a(class="page-link", href=(sort == "asc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=0" + "&sort=asc"))
  10. span(aria-hidden="true") Oldest blocks first
  11. li(class="page-item", class=(sort == "desc" ? "active" : false))
  12. a(class="page-link", href=(sort == "desc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=0" + "&sort=desc"))
  13. span(aria-hidden="true") Newest blocks first
  14. include includes/blocks-list.pug
  15. hr
  16. if (blockCount > limit)
  17. - var pageNumber = offset / limit + 1;
  18. - var pageCount = Math.floor(blockCount / limit);
  19. - if (pageCount * limit < blockCount) {
  20. - pageCount++;
  21. - }
  22. - var paginationUrlFunction = function(x) {
  23. - return paginationBaseUrl + "?limit=" + limit + "&offset=" + ((x - 1) * limit + "&sort=" + sort);
  24. - }
  25. hr
  26. include includes/pagination.pug
  27. else
  28. p No blocks found