Browse Source
Try to avoid using globals in templates...WIP
master
Dan Janosik
5 years ago
No known key found for this signature in database
GPG Key ID: C6F8CE9FFDB2CED2
6 changed files with
11 additions and
11 deletions
-
views/fun.pug
-
views/includes/block-content.pug
-
views/includes/transaction-io-details.pug
-
views/index.pug
-
views/layout.pug
-
views/transaction.pug
|
@ -21,7 +21,7 @@ block content |
|
|
th.data-header Reference |
|
|
th.data-header Reference |
|
|
tbody |
|
|
tbody |
|
|
each item, index in coinConfig.historicalData |
|
|
each item, index in coinConfig.historicalData |
|
|
if (item.chain == global.activeBlockchain) |
|
|
if (item.chain == activeBlockchain) |
|
|
tr |
|
|
tr |
|
|
td.data-cell #{item.date} |
|
|
td.data-cell #{item.date} |
|
|
|
|
|
|
|
|
|
@ -140,7 +140,7 @@ div.tab-content |
|
|
else |
|
|
else |
|
|
span 0 |
|
|
span 0 |
|
|
|
|
|
|
|
|
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain); |
|
|
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, activeBlockchain); |
|
|
- var coinbaseTxTotalOutputValue = new Decimal(0); |
|
|
- var coinbaseTxTotalOutputValue = new Decimal(0); |
|
|
each vout in result.getblock.coinbaseTx.vout |
|
|
each vout in result.getblock.coinbaseTx.vout |
|
|
- coinbaseTxTotalOutputValue = coinbaseTxTotalOutputValue.plus(new Decimal(vout.value)); |
|
|
- coinbaseTxTotalOutputValue = coinbaseTxTotalOutputValue.plus(new Decimal(vout.value)); |
|
|
|
@ -93,7 +93,7 @@ div.row.text-monospace |
|
|
|
|
|
|
|
|
div.tx-io-value |
|
|
div.tx-io-value |
|
|
if (txVin.coinbase) |
|
|
if (txVin.coinbase) |
|
|
- var currencyValue = coinConfig.blockRewardFunction(blockHeight, global.activeBlockchain); |
|
|
- var currencyValue = coinConfig.blockRewardFunction(blockHeight, activeBlockchain); |
|
|
include ./value-display.pug |
|
|
include ./value-display.pug |
|
|
else |
|
|
else |
|
|
if (vout && vout.value) |
|
|
if (vout && vout.value) |
|
|
|
@ -15,7 +15,7 @@ block content |
|
|
if (config.demoSite && session.hideHomepageBanner != "true") |
|
|
if (config.demoSite && session.hideHomepageBanner != "true") |
|
|
div.alert.alert-primary.alert-dismissible.shadow-sm.mb-3(role="alert") |
|
|
div.alert.alert-primary.alert-dismissible.shadow-sm.mb-3(role="alert") |
|
|
span |
|
|
span |
|
|
span.font-weight-bold #{coinConfig.siteTitlesByNetwork[global.activeBlockchain]} |
|
|
span.font-weight-bold #{coinConfig.siteTitlesByNetwork[activeBlockchain]} |
|
|
span is |
|
|
span is |
|
|
a(href="https://github.com/janoside/btc-rpc-explorer", target="_blank") open-source |
|
|
a(href="https://github.com/janoside/btc-rpc-explorer", target="_blank") open-source |
|
|
span and easy to set up. It can communicate with your |
|
|
span and easy to set up. It can communicate with your |
|
|
|
@ -31,8 +31,8 @@ html(lang="en") |
|
|
div.container |
|
|
div.container |
|
|
a.navbar-brand(href="/") |
|
|
a.navbar-brand(href="/") |
|
|
span |
|
|
span |
|
|
if (coinConfig.logoUrlsByNetwork && coinConfig.logoUrlsByNetwork[global.activeBlockchain]) |
|
|
if (coinConfig.logoUrlsByNetwork && coinConfig.logoUrlsByNetwork[activeBlockchain]) |
|
|
img.header-image(src=coinConfig.logoUrlsByNetwork[global.activeBlockchain], alt="logo") |
|
|
img.header-image(src=coinConfig.logoUrlsByNetwork[activeBlockchain], alt="logo") |
|
|
else |
|
|
else |
|
|
img.header-image(src="/img/logo/btc.svg", alt="logo") |
|
|
img.header-image(src="/img/logo/btc.svg", alt="logo") |
|
|
|
|
|
|
|
@ -49,11 +49,11 @@ html(lang="en") |
|
|
a.nav-link(href="/about") |
|
|
a.nav-link(href="/about") |
|
|
span About |
|
|
span About |
|
|
|
|
|
|
|
|
if (global.activeBlockchain != "main") |
|
|
if (activeBlockchain != "main") |
|
|
- var chainName = global.activeBlockchain == "test" ? "testnet" : global.activeBlockchain |
|
|
- var chainName = activeBlockchain == "test" ? "testnet" : activeBlockchain |
|
|
|
|
|
|
|
|
li.nav-item |
|
|
li.nav-item |
|
|
a.nav-link.text-warning(title=`Current node's chain: ${global.activeBlockchain}` data-toggle="tooltip") [#{chainName}] |
|
|
a.nav-link.text-warning(title=`Current node's chain: ${activeBlockchain}` data-toggle="tooltip") [#{chainName}] |
|
|
|
|
|
|
|
|
if (config.siteTools) |
|
|
if (config.siteTools) |
|
|
li.nav-item.dropdown |
|
|
li.nav-item.dropdown |
|
|
|
@ -27,7 +27,7 @@ block content |
|
|
|
|
|
|
|
|
- var totalInputValue = new Decimal(0); |
|
|
- var totalInputValue = new Decimal(0); |
|
|
if (result.getrawtransaction.vin[0].coinbase) |
|
|
if (result.getrawtransaction.vin[0].coinbase) |
|
|
- totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain))); |
|
|
- totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height, activeBlockchain))); |
|
|
each txInput, txInputIndex in result.txInputs |
|
|
each txInput, txInputIndex in result.txInputs |
|
|
if (txInput) |
|
|
if (txInput) |
|
|
- var vout = txInput; |
|
|
- var vout = txInput; |
|
@ -178,7 +178,7 @@ block content |
|
|
- var currencyValue = new Decimal(totalOutputValue).minus(totalInputValue); |
|
|
- var currencyValue = new Decimal(totalOutputValue).minus(totalInputValue); |
|
|
include includes/value-display.pug |
|
|
include includes/value-display.pug |
|
|
|
|
|
|
|
|
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, global.activeBlockchain); |
|
|
- var blockRewardMax = coinConfig.blockRewardFunction(result.getblock.height, activeBlockchain); |
|
|
if (parseFloat(totalOutputValue) < parseFloat(blockRewardMax)) |
|
|
if (parseFloat(totalOutputValue) < parseFloat(blockRewardMax)) |
|
|
div.row |
|
|
div.row |
|
|
div.summary-table-label |
|
|
div.summary-table-label |
|
|