From 8e8d67f334e41f2b2da0d19062c47e4ce5f69113 Mon Sep 17 00:00:00 2001 From: Dan Janosik Date: Sat, 23 Feb 2019 17:34:15 -0500 Subject: [PATCH] minor cleanup / reorg --- app/auth.js | 2 +- app/config.js | 21 ++++++++++++--------- views/layout.pug | 20 +++++++++++--------- 3 files changed, 24 insertions(+), 19 deletions(-) diff --git a/app/auth.js b/app/auth.js index 4442f89..9aedb7f 100644 --- a/app/auth.js +++ b/app/auth.js @@ -6,7 +6,7 @@ module.exports = pass => (req, res, next) => { if (cred && cred.pass === pass) { req.authenticated = true; return next(); - } + } res.set('WWW-Authenticate', `Basic realm="Private Area"`) .sendStatus(401); diff --git a/app/config.js b/app/config.js index 72b3911..114b0d5 100644 --- a/app/config.js +++ b/app/config.js @@ -114,6 +114,18 @@ module.exports = { browseBlocksPageSize:20, addressPage:{ txOutputMaxDefaultDisplay:10 + }, + header:{ + dropdowns:[ + { + title:"Related Sites", + links:[ + {name: "Bitcoin Explorer", url:"https://btc.chaintools.io", imgUrl:"/img/logo/btc.svg"}, + {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"}, + ] + } + ] } }, @@ -148,14 +160,5 @@ module.exports = { storeId:"DUUExHMvKNAFukrJZHCShMhwZvfPq87QnkUhvE6h5kh2", notifyEmail:"chaintools.io@gmail.com" } - }, - - headerDropdownLinks: { - title:"Related Sites", - links:[ - {name: "Bitcoin Explorer", url:"https://btc.chaintools.io", imgUrl:"/img/logo/btc.svg"}, - {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"}, - ] } }; diff --git a/views/layout.pug b/views/layout.pug index 6109555..d03459b 100644 --- a/views/layout.pug +++ b/views/layout.pug @@ -53,15 +53,17 @@ html(lang="en") i(class=item.fontawesome, style="width: 20px; margin-right: 10px;") span #{item.name} - if (config.headerDropdownLinks) - li(class="nav-item dropdown") - a(class="nav-link dropdown-toggle", href="javascript:void(0)", role="button", data-toggle="dropdown", aria-haspopup="true", aria-expanded="false") - span #{config.headerDropdownLinks.title} - div(class="dropdown-menu", aria-label=(config.headerDropdownLinks.title + " Items")) - each item in config.headerDropdownLinks.links - a(class="dropdown-item", href=item.url) - img(src=item.imgUrl, style="width: 24px; height: 24px; margin-right: 8px;", alt=item.name) - span #{item.name} + if (config.site.header.dropdowns) + each dropdown, ddIndex in config.site.header.dropdowns + li(class="nav-item dropdown") + a(class="nav-link dropdown-toggle", href="javascript:void(0)", role="button", data-toggle="dropdown", aria-haspopup="true", aria-expanded="false") + span #{dropdown.title} + div(class="dropdown-menu", aria-label=(dropdown.title + " Items")) + each dropdownLink in dropdown.links + a(class="dropdown-item", href=dropdownLink.url) + if (dropdownLink.imgUrl) + img(src=dropdownLink.imgUrl, style="width: 24px; height: 24px; margin-right: 8px;", alt=dropdownLink.name) + span #{dropdownLink.name} form(method="post", action="/search", class="form-inline mr-3")