Add extended search settings
-Added a new `shared_pages.page_header.search.position` setting that determines where the search bar is located (valid options include the old 'below-header' and the new 'inside-header' options) -`shared_pages.page_header.show_search` setting has been re-mapped to `shared_pages.page_header.search.enabled` -Updated the search placeholder locale text -Changed the Explorer menu item icon from a magnifying glass to a cubes/blocks icon -Updated css rules to fix some small glitches and allow the new 'inside-header' search option to function
This commit is contained in:
+1
-1
@@ -20,7 +20,7 @@ exports.menu_claim_address = "Claim Address",
|
||||
exports.ex_title = "Block Explorer",
|
||||
exports.ex_search_title = "Search",
|
||||
exports.ex_search_button = "Search",
|
||||
exports.ex_search_message = "You may enter a block height, block hash ,tx hash or address.",
|
||||
exports.ex_search_message = "Search by block height, block hash, tx hash or address",
|
||||
exports.ex_error = "Error!",
|
||||
exports.ex_warning = "Warning",
|
||||
exports.ex_search_error = "Search found no results.",
|
||||
|
||||
+10
-2
@@ -233,9 +233,15 @@ exports.shared_pages = {
|
||||
"display_order": 3
|
||||
}
|
||||
},
|
||||
// show_search: Enable/disable the ability to search the explorer website (true/false)
|
||||
// search: A collection of settings that pertain to the search feature
|
||||
"search": {
|
||||
// enabled: Enable/disable the ability to search the explorer website (true/false)
|
||||
// If set to false, the explorer will not display a search box or respond to search queries
|
||||
"show_search": true
|
||||
"enabled": true,
|
||||
// position: Determine where the search box should appear on the website
|
||||
// valid options: inside-header, below-header
|
||||
"position": "inside-header"
|
||||
}
|
||||
},
|
||||
// page_footer: A collection of settings that pertain to the page footer that is displayed at the bottom of all pages
|
||||
"page_footer": {
|
||||
@@ -1155,6 +1161,8 @@ exports.loadSettings = function loadSettings() {
|
||||
json_settings = fix_deprecated_setting(json_settings, 'wallet.user', 'wallet.username');
|
||||
json_settings = fix_deprecated_setting(json_settings, 'wallet.pass', 'wallet.password');
|
||||
json_settings = fix_deprecated_setting(json_settings, 'social_links', 'shared_pages.page_footer.social_links');
|
||||
// fix old deprecated settings from v1.99
|
||||
json_settings = fix_deprecated_setting(json_settings, 'shared_pages.page_header.show_search', 'shared_pages.page_header.search.enabled');
|
||||
// check if social_links setting exists
|
||||
if (json_settings.shared_pages.page_footer.social_links != null) {
|
||||
// loop through the social links to look for and change image_url to image_path
|
||||
|
||||
+1
-1
@@ -15,7 +15,7 @@
|
||||
"ex_title": "Block Explorer",
|
||||
"ex_search_title": "Search",
|
||||
"ex_search_button": "Search",
|
||||
"ex_search_message": "You may enter a block height, block hash, tx hash or address.",
|
||||
"ex_search_message": "Search by block height, block hash, tx hash or address",
|
||||
"ex_error": "Error!",
|
||||
"ex_search_error": "Search found no results for: ",
|
||||
"ex_latest_transactions": "Latest Transactions",
|
||||
|
||||
@@ -322,6 +322,106 @@
|
||||
@include thead-light-border-color;
|
||||
}
|
||||
|
||||
@mixin header-button-light() {
|
||||
@if theme-selector.$theme-name == "Cerulean" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Cosmo" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Cyborg" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Darkly" {
|
||||
color: rgba(34, 34, 34, 0.7);
|
||||
} @else if theme-selector.$theme-name == "Exor" {
|
||||
color: rgba(34, 34, 34, 0.7);
|
||||
} @else if theme-selector.$theme-name == "Flatly" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Journal" {
|
||||
color: rgba(0, 0, 0, 0.7);
|
||||
} @else if theme-selector.$theme-name == "Litera" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Lumen" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Lux" {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
} @else if theme-selector.$theme-name == "Materia" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Minty" {
|
||||
color: rgba(0, 0, 0, 0.3);
|
||||
} @else if theme-selector.$theme-name == "Pulse" {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
} @else if theme-selector.$theme-name == "Sandstone" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Simplex" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Sketchy" {
|
||||
color: Sketchy.$gray-800;
|
||||
} @else if theme-selector.$theme-name == "Slate" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Solar" {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
} @else if theme-selector.$theme-name == "Spacelab" {
|
||||
color: rgba(0, 0, 0, 0.4);
|
||||
} @else if theme-selector.$theme-name == "Superhero" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "United" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Yeti" {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
} @else {
|
||||
color: rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
@mixin header-button-dark() {
|
||||
@if theme-selector.$theme-name == "Cerulean" {
|
||||
color: rgba(255, 255, 255, 0.8);
|
||||
} @else if theme-selector.$theme-name == "Cosmo" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Cyborg" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Darkly" {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
} @else if theme-selector.$theme-name == "Exor" {
|
||||
color: Exor.$black;
|
||||
} @else if theme-selector.$theme-name == "Flatly" {
|
||||
color: Flatly.$white;
|
||||
} @else if theme-selector.$theme-name == "Journal" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Litera" {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
} @else if theme-selector.$theme-name == "Lumen" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Lux" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Materia" {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
} @else if theme-selector.$theme-name == "Minty" {
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
} @else if theme-selector.$theme-name == "Pulse" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Sandstone" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Simplex" {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
} @else if theme-selector.$theme-name == "Sketchy" {
|
||||
color: Sketchy.$white;
|
||||
} @else if theme-selector.$theme-name == "Slate" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Solar" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Spacelab" {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
} @else if theme-selector.$theme-name == "Superhero" {
|
||||
color: rgba(255, 255, 255, 0.75);
|
||||
} @else if theme-selector.$theme-name == "United" {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
} @else if theme-selector.$theme-name == "Yeti" {
|
||||
color: rgba(255, 255, 255, 0.7);
|
||||
} @else {
|
||||
color: rgba(255, 255, 255, 0.5);
|
||||
}
|
||||
}
|
||||
|
||||
body {
|
||||
font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
|
||||
}
|
||||
@@ -374,6 +474,10 @@ h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
|
||||
}
|
||||
}
|
||||
|
||||
.nav-link {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
#index-search {
|
||||
width: 80%;
|
||||
}
|
||||
@@ -699,3 +803,70 @@ tr {
|
||||
height: 20px;
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.navbar-toggler-icon {
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
content: "";
|
||||
background: no-repeat center center;
|
||||
background-size: 100% 100%;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='30' height='30' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%280, 0, 0, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
|
||||
}
|
||||
|
||||
.navbar-toggler {
|
||||
color: #000;
|
||||
border-color: rgba(0, 0, 0, 0.1) !important;
|
||||
border-width: 1px !important;
|
||||
border-radius: .25rem !important;
|
||||
padding: .25rem .75rem !important;
|
||||
font-size: 1.171875rem !important;
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
#search-navbar-collapse {
|
||||
padding: 5px 0px;
|
||||
}
|
||||
|
||||
#search-navbar-collapse.collapse:not(.show) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#search-header-button {
|
||||
padding: .25rem .75rem;
|
||||
font-size: 1.171875rem;
|
||||
line-height: 1;
|
||||
background-color: transparent;
|
||||
border: 1px solid transparent;
|
||||
border-radius: .25rem;
|
||||
border-color: rgba(0, 0, 0, 0.1) !important;
|
||||
border-width: 1px !important;
|
||||
|
||||
> span.fa-search {
|
||||
padding-top: 5px;
|
||||
width: 1.5em;
|
||||
height: 1.5em;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-light #search-header-button {
|
||||
@include header-button-light;
|
||||
}
|
||||
|
||||
.navbar-dark #search-header-button {
|
||||
@include header-button-dark;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-link {
|
||||
color: #000;
|
||||
}
|
||||
|
||||
.navbar-nav .active .nav-link {
|
||||
color: #686868;
|
||||
}
|
||||
|
||||
.navbar-nav .nav-link:hover {
|
||||
color: #686868;
|
||||
}
|
||||
+1
-1
@@ -432,7 +432,7 @@ router.get('/address/:hash', function(req, res) {
|
||||
});
|
||||
|
||||
router.post('/search', function(req, res) {
|
||||
if (settings.shared_pages.page_header.show_search == true) {
|
||||
if (settings.shared_pages.page_header.search.enabled == true) {
|
||||
var query = req.body.search.trim();
|
||||
|
||||
if (query.length == 64) {
|
||||
|
||||
@@ -232,9 +232,15 @@
|
||||
"display_order": 3
|
||||
}
|
||||
},
|
||||
// show_search: Enable/disable the ability to search the explorer website (true/false)
|
||||
// search: A collection of settings that pertain to the search feature
|
||||
"search": {
|
||||
// enabled: Enable/disable the ability to search the explorer website (true/false)
|
||||
// If set to false, the explorer will not display a search box or respond to search queries
|
||||
"show_search": true
|
||||
"enabled": true,
|
||||
// position: Determine where the search box should appear on the website
|
||||
// valid options: inside-header, below-header
|
||||
"position": "inside-header"
|
||||
}
|
||||
},
|
||||
// page_footer: A collection of settings that pertain to the page footer that is displayed at the bottom of all pages
|
||||
"page_footer": {
|
||||
|
||||
+24
-12
@@ -286,19 +286,19 @@ html(lang='en')
|
||||
enableTooltips();
|
||||
});
|
||||
body
|
||||
- var navbarClasses = ['nav','navbar','navbar-expand-lg'];
|
||||
- var headerClasses = [];
|
||||
- var footerClasses = ['nav','navbar','navbar-default','d-none','d-md-flex','d-flex','footer'];
|
||||
if settings.shared_pages.page_header.sticky_header == true
|
||||
- navbarClasses.push('fixed-top');
|
||||
- headerClasses.push('fixed-top');
|
||||
if settings.shared_pages.page_footer.sticky_footer == true
|
||||
- footerClasses.push('fixed-bottom');
|
||||
if settings.shared_pages.page_header.bgcolor != null && settings.shared_pages.page_header.bgcolor != ''
|
||||
- navbarClasses.push('bg-' + settings.shared_pages.page_header.bgcolor);
|
||||
- headerClasses.push('bg-' + settings.shared_pages.page_header.bgcolor);
|
||||
if settings.shared_pages.page_header.bgcolor.toString().toLowerCase() == 'dark' || settings.shared_pages.page_header.bgcolor.toString().toLowerCase() == 'light'
|
||||
- navbarClasses.push('navbar-' + settings.shared_pages.page_header.bgcolor);
|
||||
- headerClasses.push('navbar-' + settings.shared_pages.page_header.bgcolor);
|
||||
else
|
||||
- navbarClasses.push('bg-primary');
|
||||
- navbarClasses.push('navbar-dark');
|
||||
- headerClasses.push('bg-primary');
|
||||
- headerClasses.push('navbar-dark');
|
||||
if settings.shared_pages.page_footer.bgcolor != null && settings.shared_pages.page_footer.bgcolor != ''
|
||||
- footerClasses.push('bg-' + settings.shared_pages.page_footer.bgcolor);
|
||||
if settings.shared_pages.page_footer.bgcolor.toString().toLowerCase() == 'dark' || settings.shared_pages.page_footer.bgcolor.toString().toLowerCase() == 'light'
|
||||
@@ -306,7 +306,8 @@ html(lang='en')
|
||||
else
|
||||
- footerClasses.push('bg-primary');
|
||||
- footerClasses.push('navbar-dark');
|
||||
div(class=navbarClasses, role='navigation', style=settings.shared_pages.page_header.home_link == 'logo' ? 'padding-left:0;' : '')
|
||||
div#main-header(class=headerClasses)
|
||||
div.nav.navbar.navbar-expand-lg(role='navigation', style=settings.shared_pages.page_header.home_link == 'logo' ? 'padding-left:0;' : '')
|
||||
.navbar-header
|
||||
button.navbar-toggler(type='button', data-toggle='collapse', data-target='#navbar-collapse')
|
||||
span.navbar-toggler-icon
|
||||
@@ -318,10 +319,10 @@ html(lang='en')
|
||||
a(href='/', alt=settings.coin.name + ' Home', title=settings.coin.name + ' Home', style='order:-1;', data-toggle='tooltip', data-placement='bottom')
|
||||
img.logo-main(src=(settings.shared_pages.page_header.home_link_logo == null || settings.shared_pages.page_header.home_link_logo == '' ? settings.shared_pages.logo : settings.shared_pages.page_header.home_link_logo), style='margin:0;max-height:' + settings.shared_pages.page_header.home_link_logo_height + 'px;')
|
||||
.collapse.navbar-collapse(id='navbar-collapse')
|
||||
ul.navbar-nav.mr-auto
|
||||
ul.navbar-nav.mr-auto(style='width:100%;')
|
||||
li#home
|
||||
a.nav-link(href='/')
|
||||
span.fa.fa-search
|
||||
span.fas.fa-cubes
|
||||
span.margin-left-5 #{settings.locale.menu_explorer}
|
||||
if settings.blockchain_specific.heavycoin.enabled == true && settings.blockchain_specific.heavycoin.reward_page.enabled == true
|
||||
li#reward
|
||||
@@ -380,12 +381,23 @@ html(lang='en')
|
||||
a.nav-link.loading(href='/claim')
|
||||
span.far.fa-address-card
|
||||
span.margin-left-5 #{settings.locale.menu_claim_address}
|
||||
div#body-container(style='margin-top:' + (settings.shared_pages.page_header.sticky_header == true ? '80px;' : '20px'))
|
||||
if settings.shared_pages.page_header.search.enabled == true && settings.shared_pages.page_header.search.position.toString().toLowerCase() == 'inside-header'
|
||||
button#search-header-button(data-toggle='collapse', data-target='#search-navbar-collapse')
|
||||
span.fas.fa-search
|
||||
if settings.shared_pages.page_header.search.enabled == true && settings.shared_pages.page_header.search.position.toString().toLowerCase() == 'inside-header'
|
||||
div#search-navbar-collapse.collapse
|
||||
div.navbar-nav.align-items-lg-center.ml-auto.search-box-custom(style='width:100%;')
|
||||
form.form-inline.col-12.d-flex.justify-content-center(method='post', action='/search')
|
||||
div.input-group.input-group-md.search-for(style='width:100%;')
|
||||
input.form-control(type='text', name='search', placeholder=settings.locale.ex_search_message)
|
||||
span.input-group-append
|
||||
button.btn.btn-success.btn-sm(type='submit') #{settings.locale.ex_search_button}
|
||||
div#body-container(style='margin-top:' + (settings.shared_pages.page_header.sticky_header == true ? '80px;' : '20px;'))
|
||||
if showSync != null && showSync == true
|
||||
.col-lg-12
|
||||
.alert.alert-warning
|
||||
.cardSpacer
|
||||
span.fas.fa-exclamation-triangle(style='margin-right:5px')
|
||||
span.fas.fa-exclamation-triangle(style='margin-right:5px;')
|
||||
strong #{settings.locale.ex_warning}
|
||||
div #{settings.locale.initial_index_alert}
|
||||
.col-lg-12
|
||||
@@ -410,7 +422,7 @@ html(lang='en')
|
||||
.col-lg-2
|
||||
.card.card-default.border-0.d-none.d-lg-block.d-block.cardSpacer(id='pnlFive')
|
||||
- }
|
||||
if settings.shared_pages.page_header.show_search == true
|
||||
if settings.shared_pages.page_header.search.enabled == true && settings.shared_pages.page_header.search.position.toString().toLowerCase() == 'below-header'
|
||||
div#search-row.row.text-center
|
||||
form.form-inline.col-12.d-flex.justify-content-center(method='post', action='/search')
|
||||
#index-search.form-group.d-flex.justify-content-center
|
||||
|
||||
Reference in New Issue
Block a user