From 1d7c5168180ac532c8bbe63f86c99ce98f9342c1 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sun, 10 Jun 2018 00:26:13 +0200 Subject: [PATCH] ui tweaks --- views/includes/block-content.pug | 21 +++++++++++++-------- views/transaction.pug | 12 ++++++------ 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/views/includes/block-content.pug b/views/includes/block-content.pug index a3b1581..25b5b11 100644 --- a/views/includes/block-content.pug +++ b/views/includes/block-content.pug @@ -140,8 +140,13 @@ div(class="tab-content") span(class="mr-2") Show div(class="btn-group", role="group") a(href=(paginationBaseUrl + "?limit=20"), class="btn btn-sm btn-primary px-2", class=((limit == 20 && txCount > limit) ? "active" : false)) 20 - a(href=(paginationBaseUrl + "?limit=50"), class="btn btn-sm btn-primary px-2", class=(limit == 50 ? "active" : false)) 50 - a(href=(paginationBaseUrl + "?limit=100"), class="btn btn-sm btn-primary px-2", class=(limit == 100 ? "active" : false)) 100 + + if (txCount > 50) + a(href=(paginationBaseUrl + "?limit=50"), class="btn btn-sm btn-primary px-2", class=(limit == 50 ? "active" : false)) 50 + + if (txCount > 100) + a(href=(paginationBaseUrl + "?limit=100"), class="btn btn-sm btn-primary px-2", class=(limit == 100 ? "active" : false)) 100 + a(href=(paginationBaseUrl + "?limit=3000"), class="btn btn-sm btn-primary px-2", class=(limit >= txCount ? "active" : false)) all if (false) @@ -177,10 +182,10 @@ div(class="tab-content") - totalInputValue = totalInputValue.plus(new Decimal(coinConfig.blockRewardFunction(result.getblock.height))); tr th 1 - td + td(class="border-top-0") span(class="tag monospace") coinbase span(class="monospace") Newly minted coins - td + td(class="border-top-0") - var currencyValue = coinConfig.blockRewardFunction(result.getblock.height); include ./value-display.pug @@ -191,14 +196,14 @@ div(class="tab-content") tr th #{(txInputIndex + 1)} - td + td(class=(txInputIndex == 0 ? "border-top-0" : false)) 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 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 + td(class=(txInputIndex == 0 ? "border-top-0" : false)) if (vout.value) - totalInputValue = totalInputValue.plus(new Decimal(vout.value)); @@ -230,7 +235,7 @@ div(class="tab-content") each vout, voutIndex in tx.vout tr th #{(voutIndex + 1)} - td + td(class=(voutIndex == 0 ? "border-top-0" : false)) if (vout.scriptPubKey) if (vout.scriptPubKey.addresses) a(id=("output-" + voutIndex), href=("/address/" + vout.scriptPubKey.addresses[0])) @@ -243,7 +248,7 @@ div(class="tab-content") else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN ')) span(class="monospace") OP_RETURN: span(class="monospace text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))} - td + td(class=(voutIndex == 0 ? "border-top-0" : false)) - var currencyValue = vout.value; include ./value-display.pug diff --git a/views/transaction.pug b/views/transaction.pug index 9206353..3f1daf5 100644 --- a/views/transaction.pug +++ b/views/transaction.pug @@ -183,10 +183,10 @@ block content if (result.getrawtransaction.vin[0].coinbase) tr th 1 - td + td(class="border-top-0") span(class="tag monospace") coinbase span(class="monospace") Newly minted coins - td + td(class="border-top-0") - var currencyValue = coinConfig.blockRewardFunction(result.getblock.height); include includes/value-display.pug @@ -199,13 +199,13 @@ block content //pre // code #{JSON.stringify(txInput)} - td + td(class=(txInputIndex == 0 ? "border-top-0" : false)) 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-" + result.getrawtransaction.vin[txInputIndex].vout), class="monospace") #{txInput.txid.substring(0, 14)}...[#{result.getrawtransaction.vin[txInputIndex].vout}] - td + td(class=(txInputIndex == 0 ? "border-top-0" : false)) if (vout.value) - var currencyValue = vout.value; include includes/value-display.pug @@ -225,7 +225,7 @@ block content each vout, voutIndex in result.getrawtransaction.vout tr th #{(voutIndex + 1)} - td + td(class=(voutIndex == 0 ? "border-top-0" : false)) if (vout.scriptPubKey) if (vout.scriptPubKey.addresses) a(id=("output-" + voutIndex), href=("/address/" + vout.scriptPubKey.addresses[0])) @@ -238,7 +238,7 @@ block content else if (vout.scriptPubKey.asm && vout.scriptPubKey.asm.startsWith('OP_RETURN ')) span(class="monospace") OP_RETURN: span(class="monospace text-muted") #{utils.hex2ascii(vout.scriptPubKey.asm.substring("OP_RETURN ".length))} - td + td(class=(voutIndex == 0 ? "border-top-0" : false)) - var currencyValue = vout.value; include includes/value-display.pug