Browse Source

styling tweaks to reduce boilerplate content to save space

fix-133-memory-crash
Dan Janosik 6 years ago
parent
commit
ffbe17e7bf
  1. 25
      views/includes/block-content.pug
  2. 34
      views/transaction.pug

25
views/includes/block-content.pug

@ -173,13 +173,6 @@ div(class="tab-content")
if (result.txInputsByTransaction[tx.txid])
- var totalInputValue = new Decimal(0);
table(class="table mb-0")
thead
tr
th(style="width: 40px;")
th Input
th Amount
tbody
if (tx.vin[0].coinbase)
- totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height)));
tr
@ -194,19 +187,17 @@ div(class="tab-content")
each txInput, txInputIndex in result.txInputsByTransaction[tx.txid]
if (txInput)
- var vout = txInput.vout[tx.vin[txInputIndex].vout];
tr
th #{(txInputIndex + 1)}
//pre
// code #{JSON.stringify(txInput)}
td
if (vout.scriptPubKey && vout.scriptPubKey.addresses)
div(class="monospace", style="word-break: break-word;")
a(href=("/address/" + vout.scriptPubKey.addresses[0])) #{vout.scriptPubKey.addresses[0]}
span(class="monospace") via
a(href=("/tx/" + txInput.txid + "#output-" + tx.vin[txInputIndex].vout), class="monospace") tx:#{txInput.txid.substring(0, 14)}...[#{tx.vin[txInputIndex].vout}]
span(class="monospace small") via
a(href=("/tx/" + txInput.txid + "#output-" + tx.vin[txInputIndex].vout), class="monospace") tx:#{txInput.txid.substring(0, 20)}...[#{tx.vin[txInputIndex].vout}]
td
if (vout.value)
- totalInputValue = totalInputValue.plus(new Decimal(vout.value));
@ -223,7 +214,7 @@ div(class="tab-content")
td
else
tr
td
th
td
td
strong
@ -235,12 +226,6 @@ div(class="tab-content")
//h6 Output (#{tx.vout.length.toLocaleString()})
- var totalOutputValue = new Decimal(0);
table(class="table mb-0")
thead
tr
th
th Output
th Amount
tbody
each vout, voutIndex in tx.vout
tr
@ -265,7 +250,7 @@ div(class="tab-content")
- totalOutputValue = totalOutputValue.plus(vout.value);
tr
td
th
td
td
strong

34
views/transaction.pug

@ -162,23 +162,23 @@ block content
div(class="card mb-3")
div(class="card-header")
div(class="row")
div(class="col-md-6")
h2(class="h6 mb-0") Input (#{result.getrawtransaction.vin.length.toLocaleString()})
div(class="col-md-6")
h2(class="h6 mb-0") Output (#{result.getrawtransaction.vout.length.toLocaleString()})
h2(class="h6 mb-0")
span #{result.getrawtransaction.vin.length.toLocaleString()}
if (result.getrawtransaction.vin.length == 1)
span Input,
else
span Inputs,
span #{result.getrawtransaction.vout.length.toLocaleString()}
if (result.getrawtransaction.vout.length == 1)
span Output
else
span Outputs
div(class="card-body")
div(class="row")
div(class="col-md-6")
if (result.txInputs)
table(class="table mb-0")
thead
tr
th(style="width: 40px;")
th Input
th Amount
tbody
if (result.getrawtransaction.vin[0].coinbase)
tr
th 1
@ -210,7 +210,7 @@ block content
include includes/value-display.pug
tr
td
th
td
td
strong
@ -220,12 +220,6 @@ block content
div(class="col-md-6")
table(class="table mb-0")
thead
tr
th
th Output
th Amount
tbody
each vout, voutIndex in result.getrawtransaction.vout
tr
@ -248,7 +242,7 @@ block content
include includes/value-display.pug
tr
td
th
td
td
strong

Loading…
Cancel
Save