From 86119da883b0aae6214b7cde1c20a67a0fb56fca Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 26 Apr 2019 18:04:36 +0300 Subject: [PATCH 1/9] Improve chains menu --- .../assets/css/components/_navbar.scss | 2 ++ apps/block_scout_web/config/config.exs | 12 ++++++++---- .../templates/layout/_topnav.html.eex | 7 +++++-- .../lib/block_scout_web/views/layout_view.ex | 9 +++++++++ 4 files changed, 24 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 685fbb2fec..0ae67d0be8 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -161,6 +161,8 @@ &.header { font-weight: bold; + padding-left: 10px; + pointer-events: none; &.division { border-top: 1px solid rgb(183, 185, 184); diff --git a/apps/block_scout_web/config/config.exs b/apps/block_scout_web/config/config.exs index d8e68d4e9f..9e5474af8c 100644 --- a/apps/block_scout_web/config/config.exs +++ b/apps/block_scout_web/config/config.exs @@ -67,19 +67,23 @@ config :block_scout_web, }, %{ title: "Ethereum Classic", - url: "https://blockscout.com/etc/mainnet" + url: "https://blockscout.com/etc/mainnet", + other?: true }, %{ title: "Aerum Mainnet", - url: "https://blockscout.com/aerum/mainnet" + url: "https://blockscout.com/aerum/mainnet", + other?: true }, %{ title: "Callisto Mainnet", - url: "https://blockscout.com/callisto/mainnet" + url: "https://blockscout.com/callisto/mainnet", + other?: true }, %{ title: "RSK Mainnet", - url: "https://blockscout.com/rsk/mainnet" + url: "https://blockscout.com/rsk/mainnet", + other?: true } ] diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index f6eb3730e4..be7e14afa9 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -120,14 +120,17 @@ <%= subnetwork_title() %> diff --git a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex index fcde8d5371..5c5cd84ce9 100644 --- a/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex +++ b/apps/block_scout_web/lib/block_scout_web/views/layout_view.ex @@ -102,10 +102,19 @@ defmodule BlockScoutWeb.LayoutView do Enum.reject(other_networks(), &Map.get(&1, :test_net?)) end + def head_main_nets do + main_nets() + |> Enum.reject(&Map.get(&1, :other?)) + end + def test_nets do Enum.filter(other_networks(), &Map.get(&1, :test_net?)) end + def other_nets do + Enum.filter(other_networks(), &Map.get(&1, :other?)) + end + def other_explorers do if Application.get_env(:block_scout_web, :link_to_other_explorers) do Application.get_env(:block_scout_web, :other_explorers, []) From c2a6c5936e3e25c6f92c18a8c26934d4ec48314d Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 26 Apr 2019 18:07:13 +0300 Subject: [PATCH 2/9] "Testnet" -> "Testnets" --- .../lib/block_scout_web/templates/layout/_topnav.html.eex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index be7e14afa9..4041f7a68f 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -123,7 +123,7 @@ <%= for %{url: url, title: title} <- head_main_nets() do %> <%= title %> <% end %> - Testnet + Testnets <%= for %{url: url, title: title} <- test_nets() do %> <%= title %> <% end %> From b6b8a140f19c4c4e3bb158c6078e3683abd31fea Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Fri, 26 Apr 2019 18:15:01 +0300 Subject: [PATCH 3/9] Update CHANGELOG --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6d6434cc31..4857bf1e96 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,7 @@ - [#1830](https://github.com/poanetwork/blockscout/pull/1830) - Make block size field nullable - [#1840](https://github.com/poanetwork/blockscout/pull/1840) - Handle case when total supply is nil - [#1838](https://github.com/poanetwork/blockscout/pull/1838) - Block counter calculates only consensus blocks +- [#1849](https://github.com/poanetwork/blockscout/pull/1849) - Improve chains menu ### Chore From 1ca909ac5473d92d340773323ac471513fe40846 Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Mon, 29 Apr 2019 13:01:17 +0300 Subject: [PATCH 4/9] fix gettext --- apps/block_scout_web/priv/gettext/default.pot | 8 ++++---- .../priv/gettext/en/LC_MESSAGES/default.po | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index c20096598e..c0add61ce8 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -716,8 +716,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:110 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 msgid "Search" msgstr "" @@ -1658,8 +1658,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:104 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:108 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" diff --git a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po index 98e3b97715..f409ee631b 100644 --- a/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po +++ b/apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po @@ -716,8 +716,8 @@ msgid "Responses" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:107 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:125 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:110 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:128 msgid "Search" msgstr "" @@ -1658,8 +1658,8 @@ msgid "Error: Could not determine contract creator." msgstr "" #, elixir-format -#: lib/block_scout_web/templates/layout/_topnav.html.eex:101 -#: lib/block_scout_web/templates/layout/_topnav.html.eex:105 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:104 +#: lib/block_scout_web/templates/layout/_topnav.html.eex:108 msgid "Search by address, token symbol name, transaction hash, or block number" msgstr "" From eff2182a22dca30f538651b400dae3fe9813b935 Mon Sep 17 00:00:00 2001 From: Nikita Chebykin Date: Tue, 30 Apr 2019 00:26:26 +0200 Subject: [PATCH 5/9] Update compile_solc.js --- apps/explorer/priv/compile_solc.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/explorer/priv/compile_solc.js b/apps/explorer/priv/compile_solc.js index 6e9489d433..7179ebda56 100755 --- a/apps/explorer/priv/compile_solc.js +++ b/apps/explorer/priv/compile_solc.js @@ -12,7 +12,7 @@ var evmVersion = process.argv[8]; var compiled_code = solc.loadRemoteVersion(version, function (err, solcSnapshot) { if (err) { - console.log(JSON.stringify(err)); + console.log(JSON.stringify(err.message)); } else { const input = { language: 'Solidity', From 405db89de8e863361ae3dee4aa74203523eafe6d Mon Sep 17 00:00:00 2001 From: Victor Baranov Date: Tue, 30 Apr 2019 14:05:07 +0300 Subject: [PATCH 6/9] Add header for "Mainnets" --- .../assets/css/components/_dropdown.scss | 3 ++- .../block_scout_web/assets/css/components/_navbar.scss | 10 ---------- .../block_scout_web/templates/layout/_topnav.html.eex | 1 + 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_dropdown.scss b/apps/block_scout_web/assets/css/components/_dropdown.scss index aa16e5b300..b603d53fea 100644 --- a/apps/block_scout_web/assets/css/components/_dropdown.scss +++ b/apps/block_scout_web/assets/css/components/_dropdown.scss @@ -45,6 +45,7 @@ &, &:hover, &:active { + padding-left: 10px; background-color: transparent; cursor: default; color: #333; @@ -53,7 +54,7 @@ } &.division { - border-color: $base-border-color; + border-top: 1px solid $base-border-color; } } diff --git a/apps/block_scout_web/assets/css/components/_navbar.scss b/apps/block_scout_web/assets/css/components/_navbar.scss index 024ed5fa81..0999ef327c 100644 --- a/apps/block_scout_web/assets/css/components/_navbar.scss +++ b/apps/block_scout_web/assets/css/components/_navbar.scss @@ -217,16 +217,6 @@ $navbar-logo-width: auto !default; padding-left: $header-link-horizontal-padding; padding-right: $header-link-horizontal-padding; } - - &.header { - font-weight: bold; - padding-left: 10px; - pointer-events: none; - - &.division { - border-top: 1px solid rgb(183, 185, 184); - } - } } .add-border { diff --git a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex index b2728c1084..032ab22930 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/layout/_topnav.html.eex @@ -84,6 +84,7 @@ <%= subnetwork_title() %>