Browse Source

Making testnet demo site more prominent

master
Dan Janosik 5 years ago
parent
commit
7bef55d343
No known key found for this signature in database GPG Key ID: C6F8CE9FFDB2CED2
  1. 12
      app/coins/btc.js
  2. 1
      app/config.js
  3. 1
      public/img/logo/tbtc.svg
  4. 9
      routes/baseActionsRouter.js
  5. 34
      views/includes/index-network-summary.pug
  6. 2
      views/index.pug
  7. 22
      views/layout.pug

12
app/coins/btc.js

@ -52,8 +52,16 @@ var currencyUnits = [
module.exports = {
name:"Bitcoin",
ticker:"BTC",
logoUrl:"/img/logo/btc.svg",
siteTitle:"Bitcoin Explorer",
logoUrlsByNetwork:{
"main":"/img/logo/btc.svg",
"test":"/img/logo/tbtc.svg",
"regtest":"/img/logo/tbtc.svg"
},
siteTitlesByNetwork: {
"main":"Bitcoin Explorer",
"test":"Testnet Explorer",
"regtest":"Regtest Explorer"
},
siteDescriptionHtml:"<b>BTC Explorer</b> is <a href='https://github.com/janoside/btc-rpc-explorer). If you run your own [Bitcoin Full Node](https://bitcoin.org/en/full-node), **BTC Explorer** can easily run alongside it, communicating via RPC calls. See the project [ReadMe](https://github.com/janoside/btc-rpc-explorer) for a list of features and instructions for running.",
nodeTitle:"Bitcoin Full Node",
nodeUrl:"https://bitcoin.org/en/full-node",

1
app/config.js

@ -158,6 +158,7 @@ module.exports = {
title:"Related Sites",
links:[
{name: "Bitcoin Explorer", url:"https://explorer.btc21.org", imgUrl:"/img/logo/btc.svg"},
{name: "Testnet Explorer", url:"https://testnet.btc21.org", imgUrl:"/img/logo/tbtc.svg"},
{name: "LND Admin", url:"https://lnd-admin.chaintools.io", imgUrl:"/img/logo/lnd-admin.png"},
//{name: "Litecoin Explorer", url:"https://ltc.chaintools.io", imgUrl:"/img/logo/ltc.svg"},
//{name: "Lightning Explorer", url:"https://lightning.chaintools.io", imgUrl:"/img/logo/lightning.svg"},

1
public/img/logo/tbtc.svg

@ -0,0 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="32" height="32"><g fill="none" fill-rule="evenodd"><circle cx="16" cy="16" r="16" fill="#39b703"/><path fill="#FFF" fill-rule="nonzero" d="M23.189 14.02c.314-2.096-1.283-3.223-3.465-3.975l.708-2.84-1.728-.43-.69 2.765c-.454-.114-.92-.22-1.385-.326l.695-2.783L15.596 6l-.708 2.839c-.376-.086-.746-.17-1.104-.26l.002-.009-2.384-.595-.46 1.846s1.283.294 1.256.312c.7.175.826.638.805 1.006l-.806 3.235c.048.012.11.03.18.057l-.183-.045-1.13 4.532c-.086.212-.303.531-.793.41.018.025-1.256-.313-1.256-.313l-.858 1.978 2.25.561c.418.105.828.215 1.231.318l-.715 2.872 1.727.43.708-2.84c.472.127.93.245 1.378.357l-.706 2.828 1.728.43.715-2.866c2.948.558 5.164.333 6.097-2.333.752-2.146-.037-3.385-1.588-4.192 1.13-.26 1.98-1.003 2.207-2.538zm-3.95 5.538c-.533 2.147-4.148.986-5.32.695l.95-3.805c1.172.293 4.929.872 4.37 3.11zm.535-5.569c-.487 1.953-3.495.96-4.47.717l.86-3.45c.975.243 4.118.696 3.61 2.733z"/></g></svg>

After

Width:  |  Height:  |  Size: 956 B

9
routes/baseActionsRouter.js

@ -184,6 +184,15 @@ router.get("/", function(req, res, next) {
res.render("index");
next();
}).catch(function(err) {
utils.logError("32978efegdde", err);
res.locals.userMessage = "Error loading recent blocks: " + err;
res.render("index");
next();
});
});

34
views/includes/index-network-summary.pug

@ -8,24 +8,26 @@ div.row.index-summary
div(class=colClass)
h5.h6 Mining
- var hashrate1dayData0 = utils.formatLargeNumber(hashrate1d, 0);
- var hashrate7dayData0 = utils.formatLargeNumber(hashrate7d, 0);
- var hashrate1dayData1 = utils.formatLargeNumber(hashrate1d, 1);
- var hashrate7dayData1 = utils.formatLargeNumber(hashrate7d, 1);
table.table.table-borderless.table-sm.table-hover.mb-lg-0
tbody
tr
th.px-2.px-lg-0.px-xl-2
i.fas.fa-tachometer-alt.mr-1.summary-icon
span.border-dotted(title="Estimates for global network hashrate for 1 day / 7 days.", data-toggle="tooltip") Hashrate
small.ml-1 (d/w)
td.text-right.text-monospace
span.d-xxl-none #{hashrate1dayData0[0]}
span.d-none.d-xxl-inline #{hashrate1dayData1[0]}
small.text-muted /
span.d-xxl-none #{hashrate7dayData0[0]}
span.d-none.d-xxl-inline #{hashrate7dayData1[0]}
small.border-dotted(title=`${hashrate1dayData0[1].abbreviation}H = ${hashrate1dayData0[1].name}-hash (x10^${hashrate1dayData0[1].exponent})`, data-toggle="tooltip") #{hashrate1dayData0[1].abbreviation}H/s
if (hashrate1d && hashrate7d)
- var hashrate1dayData0 = utils.formatLargeNumber(hashrate1d, 0);
- var hashrate7dayData0 = utils.formatLargeNumber(hashrate7d, 0);
- var hashrate1dayData1 = utils.formatLargeNumber(hashrate1d, 1);
- var hashrate7dayData1 = utils.formatLargeNumber(hashrate7d, 1);
tr
th.px-2.px-lg-0.px-xl-2
i.fas.fa-tachometer-alt.mr-1.summary-icon
span.border-dotted(title="Estimates for global network hashrate for 1 day / 7 days.", data-toggle="tooltip") Hashrate
small.ml-1 (d/w)
td.text-right.text-monospace
span.d-xxl-none #{hashrate1dayData0[0]}
span.d-none.d-xxl-inline #{hashrate1dayData1[0]}
small.text-muted /
span.d-xxl-none #{hashrate7dayData0[0]}
span.d-none.d-xxl-inline #{hashrate7dayData1[0]}
small.border-dotted(title=`${hashrate1dayData0[1].abbreviation}H = ${hashrate1dayData0[1].name}-hash (x10^${hashrate1dayData0[1].exponent})`, data-toggle="tooltip") #{hashrate1dayData0[1].abbreviation}H/s
tr
th.px-2.px-lg-0.px-xl-2

2
views/index.pug

@ -15,7 +15,7 @@ block content
if (config.demoSite && session.hideHomepageBanner != "true")
div.alert.alert-primary.alert-dismissible.shadow-sm.mb-3(role="alert")
span
span.font-weight-bold #{coinConfig.siteTitle}
span.font-weight-bold #{coinConfig.siteTitlesByNetwork[global.activeBlockchain]}
span is
a(href="https://github.com/janoside/btc-rpc-explorer", target="_blank") open-source
span and easy to set up. It can communicate with your

22
views/layout.pug

@ -31,9 +31,12 @@ html(lang="en")
div.container
a.navbar-brand(href="/")
span
if (coinConfig.logoUrl)
img.header-image(src=coinConfig.logoUrl, alt="logo")
span #{coinConfig.siteTitle}
if (coinConfig.logoUrlsByNetwork && coinConfig.logoUrlsByNetwork[global.activeBlockchain])
img.header-image(src=coinConfig.logoUrlsByNetwork[global.activeBlockchain], alt="logo")
else
img.header-image(src="/img/logo/btc.svg", alt="logo")
span #{coinConfig.siteTitlesByNetwork[global.activeBlockchain]}
button.navbar-toggler.navbar-toggler-right(type="button", data-toggle="collapse", data-target="#navbarNav", aria-label="collapse navigation")
span.navbar-toggler-icon
@ -141,7 +144,7 @@ html(lang="en")
span.badge.badge-danger.ml-2 #{pageErrors.length.toLocaleString()}
if (userMessage)
div.alert(class=(userMessageType ? `alert-${userMessageType} border-${userMessageType}` : "alert-warning border-warning"), role="alert")
div.alert(class=(userMessageType ? `alert-${userMessageType}` : "alert-warning"), role="alert")
span #{userMessage}
block content
@ -197,10 +200,13 @@ html(lang="en")
a(href="https://explorer.btc21.org") https://explorer.btc21.org
div.mt-2
- var demoSiteCoins = ["BTC"];
each demoSiteCoin in demoSiteCoins
a.mr-2(href=coinConfigs[demoSiteCoin].demoSiteUrl, title=coinConfigs[demoSiteCoin].siteTitle)
img(src=("/img/logo/" + demoSiteCoin.toLowerCase() + ".svg"), alt=demoSiteCoin.toLowerCase())
- var demoSites = [];
- demoSites.push({url:"https://explorer.btc21.org", logoUrl:"/img/logo/btc.svg", title:"Bitcoin Explorer"});
- demoSites.push({url:"https://testnet.btc21.org", logoUrl:"/img/logo/tbtc.svg", title:"Testnet Explorer"});
each demoSite in demoSites
a.mr-2(href=demoSite.url, title=demoSite.title)
img(src=demoSite.logoUrl, alt=demoSite.title)
a.mr-2(href="https://lnd-admin.chaintools.io", title="LND Admin")
img(src=("/img/logo/lnd-admin.png"), style="width: 32px; height: 32px;", alt="LND Admin")

Loading…
Cancel
Save