Skip to content

Commit

Permalink
support configurable menu
Browse files Browse the repository at this point in the history
  • Loading branch information
hackmod committed Oct 4, 2019
1 parent 6429d74 commit ad03a70
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 87 deletions.
31 changes: 30 additions & 1 deletion config.example.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,35 @@
"0xeda79f0735a56510876a497e1c105916666b0199": "Comining",
"0xd3bfd58a31ddeb2fdd2bc212e38c41725bc93ccd": "EtherDig HVPPS",
"0xf35074bbd0a9aee46f4ea137971feec024ab704e": "solopool.org"
}
},
"menu": {
"Tokens": { "link":"/token" },
"Accounts": { "link": "/accounts" },
"Stats": {
"link":"",
"items": [
{"title":"HashRate Chart","link":"/stats/hashrate", "iconClass":"fa fa-line-chart"},
{"title":"Miner Distribution Chart","link":"/stats/miner_hashrate", "iconClass":"fa fa-line-chart"},
{"title":"Difficulty Chart","link":"/stats/difficulty", "iconClass":"fa fa-line-chart"},
{"title":"Blocktime Chart","link":"/stats/blocktime", "iconClass":"fa fa-line-chart"}
]
},
"Misc": {
"link":"",
"items": [
{"title":"Verify Contract (N/A)","link":"", "iconClass":"icon-check"}
]
},
"Community": {
"link":"",
"items": [
{"title":"The Forum","link":"https://forum.ethereumclassic.org", "target":"_blank", "title":"Community Chat", "iconClass":"fa fa-group"},
{"title":"TokenMint.io","link":"https://tokenmint.io", "target":"_blank", "title":"ERC223 Token Factory", "iconClass":"fa fa-leaf"},
{"title":"ClassicEtherWallet.com","link":"https://ethereumproject.github.io/etherwallet/", "target":"_blank", "tooltip":"Client Side JS ETC Wallet", "iconClass":"fa fa-leaf"},
{"title":"Live Network Stats","link":"https://classicstats.net", "target":"_blank", "tooltip":"Mainnet Stats", "iconClass":"fa fa-bar-chart"},
{"title":"Statebot.io","link":"http://statebot.info", "target":"_blank", "tooltip":"JSON state dumps for analysis", "iconClass":"fa fa-android"}
]
}
}
}
}
3 changes: 0 additions & 3 deletions public/css/etc-explorer.css
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,6 @@ i.verified:before{
tr.ng-scope {
white-space: nowrap;
}
li.ng-scope {
width: calc(100% - 16px);
}
.table-scrollable {
margin: 0 !important;
}
Expand Down
5 changes: 5 additions & 0 deletions public/css/layout.css
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,7 @@
display: none;
}

.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown .dropdown-menu>li.dropdown-submenu.open>.dropdown-menu,.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown li.open>.dropdown-menu,.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown.open>.dropdown-menu,
.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown .dropdown-menu>li.dropdown-submenu.open>.dropdown-menu,.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown li.opened>.dropdown-menu,.page-header .page-header-menu .hor-menu .navbar-nav li.classic-menu-dropdown.opened>.dropdown-menu {
display: block;
}
Expand Down Expand Up @@ -1905,3 +1906,7 @@ body,html {
display: none;
transition: all 2s;
}

.dropdown-menu hr {
margin: 0;
}
93 changes: 10 additions & 83 deletions public/tpl/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,90 +41,17 @@
<li class="active">
<a href="/">Home</a>
</li>
<li ng-show="settings.useRichList">
<a href="/accounts">Accounts</a>
</li>
<li>
<a href="/token">Tokens</a>
</li>
<li class="menu-dropdown mega-menu-dropdown ">
<a data-hover="megamenu-dropdown" data-close-others="true" data-toggle="dropdown" href="#" class="dropdown-toggle"> Stats
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu">
<li>
<div class="mega-menu-content">
<div class="row">
<div class="col-md-12">
<ul class="mega-menu-submenu">
<li>
<a href="/stats/hashrate">
<i class="fa fa-line-chart"></i> Hashrate Chart </a>
</li>
<li>
<a href="/stats/miner_hashrate">
<i class="fa fa-line-chart"></i> Miner Distribution Chart</a>
</li>
<li>
<a href="/stats/difficulty">
<i class="fa fa-line-chart"></i> Difficulty Chart</a>
</li>
<li>
<a href="/stats/blocktime">
<i class="fa fa-line-chart"></i> Blocktime Chart</a>
</li>
</ul>
</div>
</div>
</div>
</li>
</ul>
</li>
<li class="menu-dropdown classic-menu-dropdown ">
<a data-hover="megamenu-dropdown" data-close-others="true" data-toggle="dropdown" href="#"> Misc
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu pull-left">
<li>
<a href="/contract">
<i class="icon-check"></i> Verify Contract </a>
</li>
</ul>
</li>
<li class="menu-dropdown classic-menu-dropdown ">
<a data-hover="megamenu-dropdown" data-close-others="true" data-toggle="dropdown" href="#"> Community
<i class="fa fa-angle-down"></i>
<li ng-repeat="(key, menu) in settings.menu" class="menu-dropdown classic-menu-dropdown"
ng-if="key != 'Accounts' || (key == 'Accounts' && settings.showRichList)">
<a ng-if="menu.items" data-hover="megamenu-dropdown" data-close-others="true" data-toggle="dropdown" ng-attr-href="{{menu.link || '#'}}"> {{key}}
<i class="fa fa-angle-down"></i>
</a>
<ul class="dropdown-menu pull-left">
<li>
<a href="https://forum.ethereumclassic.org" target="_blank">
<i class="fa fa-group"></i>
<span class="title" data-toggle="tooltip" title="Community Chat"> The Forum</span>
</a>
</li>
<li>
<a href="https://tokenmint.io" target="_blank">
<i class="fa fa-leaf"></i>
<span class="title" data-toggle="tooltip" title="ERC223 Token Factory" > TokenMint.io</span>
</a>
</li>
<li>
<a href=" https://ethereumclassic.github.io/etherwallet/ " target="_blank">
<i class="fa fa-folder-open"></i>
<span class="title" data-toggle="tooltip" title="Client Side JS ETC Wallet"> ClassicEtherWallet.com</span>
</a>
</li>
<li>
<a href="https://2miners.com/etc-stats" target="_blank">
<i class="fa fa-bar-chart"></i>
<span class="title" data-toggle="tooltip" title="Mainnet Stats"> Live Network Stats </span>
</a>
</li>
<li>
<a href="http://statebot.info" target="_blank">
<i class="fa fa-android"></i>
<span class="title" data-toggle="tooltip" title="JSON state dumps for analysis"> Statebot.io </span>
</a>
<a ng-if="!menu.items" ng-attr-href="{{menu.link || '#'}}">{{key}}</a>
<ul ng-if="menu.items" class="dropdown-menu pull-left" ng-attr-style="{{menu.style}}">
<li ng-repeat="item in menu.items">
<hr ng-if="!item.title" />
<a ng-if="item.title" href="{{item.link}}" ng-attr-target="{{item.target}}">
<i class="{{item.iconClass}}"></i><span class="title" ng-attr-title="{{item.tooltip}}" data-toggle="tooltip"> {{item.title}}</span></a>
</li>
</ul>
</li>
Expand Down

0 comments on commit ad03a70

Please sign in to comment.