Files
purple-explorer/views/block.pug
T
joeuhren f0700b65f9 Add page header/title options to all pages
-All pages (including the reward and error pages) were updated to include options for displaying a configurable page header with title, image, description and in some cases a last updated date
-The error page was restructured slightly to display a different description based on the type of error (page not found error vs problem loading page error)
-Added new setting options to the `shared_pages` setting for `page_title_image` which allows changing the page title image displayed on applicable pages and also determines whether it uses a flip/spin animation or not
-Added a collection of new `page_header` settings to all pages that control displaying the new page title + image + description and also moved the last updated date from applicable pages into this section as well
-Existing `show_last_updated` settings that were moved a level deeper into the `page_header` have been automatically mapped to the new setting location upon statup to help older installs to work better out-of-the-box
-Added new css rules to the styles.scss file to support the new page header/title options
-Added a number of new locale strings for page titles and descriptions, and moved a few locale strings around to different names internally that were already using the same naming scheme for different elements (such as api_title being moved to api_documentation for example)
-Started adding new locale strings with replacement text such as {1} and {2} that get automatically replaced with proper values when loaded to allow for locale strings that support dynamic text
-Fixed an issue with too much empty space in the page header (especially in mobile and tablet modes) when `show_panels` was set to false on any page
2021-04-10 22:22:46 -06:00

158 lines
8.7 KiB
Plaintext

extends layout
block content
include ./includes/common.pug
- var block_difficulty = parseFloat(block.difficulty).toFixed(4);
- var theadClasses = [];
if settings.shared_pages.table_header_bgcolor != null && settings.shared_pages.table_header_bgcolor != ''
- theadClasses.push('thead-' + settings.shared_pages.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();
}
});
$('span#timestampCol').html(format_unixtime(#{block.time}));
if (#{settings.shared_pages.date_time.enable_alt_timezone_tooltips} == true) {
$('span#timestampCol').attr('data-toggle', 'tooltip').attr('data-placement', 'auto').attr('title', format_unixtime(#{block.time}, true));
enableTooltips();
}
if (#{settings.shared_pages.page_header.page_title_image.enable_animation} == true && #{settings.block_page.page_header.show_img} == true)
startRotateElement('img#header-img');
});
.col-xs-12.col-md-12
if settings.block_page.page_header.show_img == true || settings.block_page.page_header.show_title == true || settings.block_page.page_header.show_description == true
#page-header-container(style='align-items:' + (settings.block_page.page_header.show_img == true && settings.block_page.page_header.show_title == true && settings.block_page.page_header.show_description == true ? 'flex-start' : 'center'))
if settings.block_page.page_header.show_img == true
#header-img-container
img#header-img(src=(settings.shared_pages.page_header.page_title_image == null || settings.shared_pages.page_header.page_title_image.image_path == null || settings.shared_pages.page_header.page_title_image.image_path == '' ? '/img/page-title-img.png' : settings.shared_pages.page_header.page_title_image.image_path))
#page-title-container
if settings.block_page.page_header.show_title == true
h3#page-title #{settings.locale.block_title.replace('{1}', settings.coin.name)}
if settings.block_page.page_header.show_description == true
if settings.block_page.page_header.show_title != true
#page-title-container
.sub-page-header.text-muted=settings.locale.block_description.replace('{1}', settings.coin.name).replace('{2}', block.height)
else
.sub-page-header.text-muted=settings.locale.block_description.replace('{1}', settings.coin.name).replace('{2}', block.height)
.cardSpacer.clearfix
.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.coin.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.coin.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)
if settings.api_page.public_apis.rpc.getblock.enabled == true
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.blockchain_specific.heavycoin.enabled == 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
- var difficulty = Number(block.difficulty).toLocaleString('en',{'minimumFractionDigits':4,'maximumFractionDigits':4,'useGrouping':true});
- var splitDifficulty = difficulty.split('.');
- var block_size = Number(block.size/1024).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':2,'useGrouping':true});
- var splitBlockSize = block_size.split('.');
if block.confirmations >= confirmations
tr.bg-success.text-dark
td.text-center=block.height
td.text-center #{splitDifficulty[0]}.
span.decimal #{splitDifficulty[1]}
td.text-center=block.confirmations
if settings.blockchain_specific.heavycoin.enabled == true
td.text-center=block.vote
td.text-center #{splitBlockSize[0]}.
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center
span#timestampCol
else
if block.confirmations < (confirmations / 2)
tr.bg-danger
td.text-center=block.height
td.text-center #{splitDifficulty[0]}.
span.decimal #{splitDifficulty[1]}
td.text-center=block.confirmations
if settings.blockchain_specific.heavycoin.enabled == true
td.text-center=block.vote
td.text-center #{splitBlockSize[0]}.
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center
span#timestampCol
else
tr.table-warning
td.text-center=block.height
td.text-center #{splitDifficulty[0]}.
span.decimal #{splitDifficulty[1]}
td.text-center=block.confirmations
if settings.blockchain_specific.heavycoin.enabled == true
td.text-center=block.vote
td.text-center #{splitBlockSize[0]}.
span.decimal #{splitBlockSize[1]}
td.text-center=block.bits
td.text-center=block.nonce
td.text-center
span#timestampCol
if block.hash == settings.block_page.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.coin.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 = Number(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 = Number(txn.total).toLocaleString('en',{'minimumFractionDigits':2,'maximumFractionDigits':8,'useGrouping':true});
- var totalParts = total.split('.');
td.text-center #{totalParts[0]}.
span.decimal #{totalParts[1]}