Browse Source

styling tweaks to reduce boilerplate content to save space

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

23
views/includes/block-content.pug

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

34
views/transaction.pug

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

Loading…
Cancel
Save