Dan Janosik
8 years ago
5 changed files with 166 additions and 28 deletions
@ -0,0 +1,32 @@ |
|||||
|
extends layout |
||||
|
|
||||
|
block content |
||||
|
h1(class="h2") Blocks |
||||
|
hr |
||||
|
|
||||
|
nav(aria-label="Page navigation") |
||||
|
ul(class="pagination justify-content-center") |
||||
|
li(class="page-item", class=(sort == "asc" ? "active" : false)) |
||||
|
a(class="page-link", href=(sort == "asc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=" + offset + "&sort=asc")) |
||||
|
span(aria-hidden="true") Oldest blocks first |
||||
|
li(class="page-item", class=(sort == "desc" ? "active" : false)) |
||||
|
a(class="page-link", href=(sort == "desc" ? "javascript:void(0)" : "/blocks?limit=" + limit + "&offset=" + offset + "&sort=desc")) |
||||
|
span(aria-hidden="true") Newest blocks first |
||||
|
|
||||
|
include includes/blocks-list.pug |
||||
|
|
||||
|
hr |
||||
|
|
||||
|
if (blockCount > limit) |
||||
|
- var pageNumber = offset / limit + 1; |
||||
|
- var pageCount = Math.floor(blockCount / limit); |
||||
|
- if (pageCount * limit < blockCount) { |
||||
|
- pageCount++; |
||||
|
- } |
||||
|
- var paginationUrlFunction = function(x) { |
||||
|
- return paginationBaseUrl + "?limit=" + limit + "&offset=" + ((x - 1) * limit + "&sort=" + sort); |
||||
|
- } |
||||
|
|
||||
|
hr |
||||
|
|
||||
|
include includes/pagination.pug |
@ -0,0 +1,17 @@ |
|||||
|
table(class="table table-striped") |
||||
|
thead |
||||
|
tr |
||||
|
th |
||||
|
th Height |
||||
|
th Timestamp (utc) |
||||
|
th Transactions |
||||
|
th Size (bytes) |
||||
|
tbody |
||||
|
each block, blockIndex in blocks |
||||
|
tr |
||||
|
th #{blockIndex + blockOffset + 1} |
||||
|
td |
||||
|
a(href=("/block-height/" + block.height)) #{block.height} |
||||
|
td #{moment.utc(new Date(parseInt(block.time) * 1000)).format("Y-MM-DD HH:mm:ss")} |
||||
|
td #{block.tx.length.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} |
||||
|
td #{block.size.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",")} |
Loading…
Reference in new issue