Files
purple-explorer/views/block.pug
T
joeuhren 3af996eeda More layout and mobile fixes
-Table columns are no longer being hidden on mobile/tablet views. Instead, clickable columns with long data (such as hashes) are now reduced to an eye icon on mobile and smaller tablets to save space. In the event that text still doesn't fit in the viewport, applicable tables now allow horizontal scrolling to reveal the rest of the data
-Many table columns had their horizontal alignment updated to better match the type of data being displayed
-Moved some table columns around to be more consistent across all pages
-Applied some additional small tweaks and fixes to provide a better overall user experience
2020-12-25 15:01:03 -07:00

124 lines
5.8 KiB
Plaintext

extends layout
block content
include ./includes/common.pug
- var time = format_unixtime(block.time);
- var block_difficulty = parseFloat(block.difficulty).toFixed(4);
- var theadClasses = [];
if settings.display.table_header_bgcolor != null && settings.display.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.display.table_header_bgcolor);
script.
$(document).ready(function() {
$('#block-summary').dataTable({
info: false,
paging: false,
searching: false,
ordering: false,
responsive: true,
scrollX: true,
fnDrawCallback: function(settings) {
fixDataTableColumns();
}
})
});
.col-xs-12.col-md-12
.card.card-default.border-0.cardSpacer
.card-header(style='padding-left:25px;padding-right:25px;')
.row
if block.previousblockhash != null
a(href='/block/' + block.previousblockhash)
span.fa.fa-chevron-left.iquidus.block-last(data-toggle='tooltip', data-placement='top', title=settings.locale.block_previous)
strong.d-none.d-md-block #{settings.symbol} block: #{block.hash}
strong.d-block.d-md-none #{settings.locale.ex_summary}
else
strong.d-none.d-md-block(style='margin-left:10px;') #{settings.symbol} #{settings.locale.ex_block}: #{block.hash}
strong.d-block.d-md-none(style='margin-left:10px;') #{settings.locale.ex_summary}
if block.nextblockhash != null
a(href='/block/' + block.nextblockhash)
span.fa.fa-chevron-right.iquidus.block-next(data-toggle='tooltip', data-placement='top', title=settings.locale.block_next)
a.d-none.d-md-block(href='/api/getblock?hash=' + block.hash, style='margin-left:auto;', data-toggle='tooltip', data-placement='top', title=settings.locale.view_raw_block_data)
span.fa.fa-info-circle.iquidus
table#block-summary.table.table-bordered.summary-table(style='border-top:0;margin-top:0 !important;')
thead(class=theadClasses)
tr
th.text-center #{settings.locale.height}
th.text-center #{settings.locale.difficulty}
th.text-center #{settings.locale.confirmations}
if settings.heavy == true
th.text-center Vote
th.text-center #{settings.locale.size} (kB)
th.text-center #{settings.locale.bits}
th.text-center #{settings.locale.nonce}
th.text-center #{settings.locale.timestamp}
tbody
if block.confirmations >= confirmations
tr.bg-success.text-dark
- var block_size = block.size/1024
td.text-center=block.height
td.text-center=Number(block.difficulty).toFixed(4)
td.text-center=block.confirmations
if settings.heavy == true
td.text-center=block.vote
td.text-center=block_size.toFixed(2)
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
else
if block.confirmations < (confirmations / 2)
tr.bg-danger
- var block_size = block.size/1024
td.text-center=block.height
td.text-center=Number(block.difficulty).toFixed(4)
td.text-center=block.confirmations
if settings.heavy == true
td.text-center=block.vote
td.text-center=block_size.toFixed(2)
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
else
tr.table-warning
- var block_size = block.size/1024
td.text-center=block.height
td.text-center=Number(block.difficulty).toFixed(4)
td.text-center=block.confirmations
if settings.heavy == true
td.text-center=block.vote
td.text-center=block_size.toFixed(2)
td.text-center=block.bits
td.text-center=block.nonce
td.text-center=time
if block.hash == settings.genesis_block
.alert.alert-info(role='alert', style='text-align:center;')
strong #{settings.locale.block_genesis}
else
.card.card-default.border-0
.card-header
strong #{settings.locale.ex_latest_transactions}
table.table.table-bordered.table-striped.summary-table.mobile-border-right
thead(class=theadClasses)
tr
th.text-center.d-table-cell.d-md-none
th.d-none.d-md-table-cell #{settings.locale.tx_hash}
th.text-center #{settings.locale.tx_recipients}
th.text-center #{settings.locale.mkt_amount}
span.small (#{settings.symbol})
tbody
each txn in txs
tr
td.text-center.d-table-cell.d-md-none
a(href='/tx/' + txn.txid)
span.fa.fa-eye(data-toggle='tooltip', data-placement='top', title=settings.locale.view_tx)
td.d-none.d-md-table-cell
a.breakWord(href='/tx/' + txn.txid) #{txn.txid}
td.text-center #{txn.vout.length}
if txn.vout.length > 0
- var total = (txn.total / 100000000).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- var totalParts = total.split('.');
td.text-center #{totalParts[0]}.
span.decimal #{totalParts[1]}
else
- var total = (txn.total).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- var totalParts = total.split('.');
td.text-center #{totalParts[0]}.
span.decimal #{totalParts[1]}