Merge pull request #2818 from poanetwork/ab-hide-percentage-of-marketcap

allow hiding marketcap percentage
pull/2829/head
Victor Baranov 5 years ago committed by GitHub
commit d7ed17f803
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      CHANGELOG.md
  2. 3
      apps/block_scout_web/config/config.exs
  3. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex
  4. 2
      apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex
  5. 10
      apps/block_scout_web/lib/block_scout_web/templates/common_components/_table-loader.html.eex
  6. 4
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex
  7. 4
      apps/block_scout_web/lib/block_scout_web/views/common_components_view.ex
  8. 24
      apps/block_scout_web/priv/gettext/default.pot
  9. 36
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -12,6 +12,7 @@
### Chore ### Chore
- [#2827](https://github.com/poanetwork/blockscout/pull/2827) - Node js 12.13.0 (latest LTS release) support - [#2827](https://github.com/poanetwork/blockscout/pull/2827) - Node js 12.13.0 (latest LTS release) support
- [#2818](https://github.com/poanetwork/blockscout/pull/2818) - allow hiding marketcap percentage
- [#2817](https://github.com/poanetwork/blockscout/pull/2817) - move docker integration documentation to blockscout docs - [#2817](https://github.com/poanetwork/blockscout/pull/2817) - move docker integration documentation to blockscout docs
- [#2808](https://github.com/poanetwork/blockscout/pull/2808) - Add tooltip for tx input - [#2808](https://github.com/poanetwork/blockscout/pull/2808) - Add tooltip for tx input
- [#2807](https://github.com/poanetwork/blockscout/pull/2807) - 422 page - [#2807](https://github.com/poanetwork/blockscout/pull/2807) - 422 page

@ -11,7 +11,8 @@ config :block_scout_web,
ecto_repos: [Explorer.Repo], ecto_repos: [Explorer.Repo],
version: System.get_env("BLOCKSCOUT_VERSION"), version: System.get_env("BLOCKSCOUT_VERSION"),
release_link: System.get_env("RELEASE_LINK"), release_link: System.get_env("RELEASE_LINK"),
decompiled_smart_contract_token: System.get_env("DECOMPILED_SMART_CONTRACT_TOKEN") decompiled_smart_contract_token: System.get_env("DECOMPILED_SMART_CONTRACT_TOKEN"),
show_percentage: if(System.get_env("SHOW_ADDRESS_MARKETCAP_PERCENTAGE", "true") == "false", do: false, else: true)
config :block_scout_web, BlockScoutWeb.Chain, config :block_scout_web, BlockScoutWeb.Chain,
network: System.get_env("NETWORK"), network: System.get_env("NETWORK"),

@ -18,12 +18,14 @@
<% end %> <% end %>
</span> </span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td color-lighten"> <td class="stakes-td color-lighten">
<!-- percentage of coins from total supply --> <!-- percentage of coins from total supply -->
<%= if @total_supply do %> <%= if @total_supply do %>
<%= balance_percentage(@address, @total_supply) %> <%= balance_percentage(@address, @total_supply) %>
<% end %> <% end %>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="mr-4"> <span class="mr-4">
<span data-test="transaction_count"> <span data-test="transaction_count">

@ -25,11 +25,13 @@
Balance Balance
</div> </div>
</th> </th>
<%= if balance_percentage_enabled?() do %>
<th class="stakes-table-th"> <th class="stakes-table-th">
<div class="stakes-table-th-content"> <div class="stakes-table-th-content">
Percentage Percentage
</div> </div>
</th> </th>
<% end %>
<th class="stakes-table-th"> <th class="stakes-table-th">
<div class="stakes-table-th-content"> <div class="stakes-table-th-content">
Txn Count Txn Count

@ -8,9 +8,11 @@
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
@ -25,9 +27,11 @@
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
@ -42,9 +46,11 @@
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
@ -59,9 +65,11 @@
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
@ -76,9 +84,11 @@
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<%= if balance_percentage_enabled?() do %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>
<% end %>
<td class="stakes-td"> <td class="stakes-td">
<span class="table-content-loader"></span> <span class="table-content-loader"></span>
</td> </td>

@ -109,6 +109,10 @@ defmodule BlockScoutWeb.AddressView do
format_wei_value(balance, :ether) format_wei_value(balance, :ether)
end end
def balance_percentage_enabled? do
Application.get_env(:block_scout_web, :show_percentage)
end
def balance_percentage(_, nil), do: "" def balance_percentage(_, nil), do: ""
def balance_percentage(%Address{fetched_coin_balance: balance}, total_supply) do def balance_percentage(%Address{fetched_coin_balance: balance}, total_supply) do

@ -1,3 +1,7 @@
defmodule BlockScoutWeb.CommonComponentsView do defmodule BlockScoutWeb.CommonComponentsView do
use BlockScoutWeb, :view use BlockScoutWeb, :view
def balance_percentage_enabled? do
Application.get_env(:block_scout_web, :show_percentage)
end
end end

@ -1027,8 +1027,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:31 #: lib/block_scout_web/templates/chain/show.html.eex:31
#: lib/block_scout_web/templates/layout/app.html.eex:60 #: lib/block_scout_web/templates/layout/app.html.eex:60
#: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:125
#: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:125
msgid "Market Cap" msgid "Market Cap"
msgstr "" msgstr ""
@ -1478,7 +1478,7 @@ msgid "Transaction Speed"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tile.html.eex:31 #: lib/block_scout_web/templates/address/_tile.html.eex:33
msgid "Transactions sent" msgid "Transactions sent"
msgstr "" msgstr ""
@ -1790,7 +1790,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:31 #: lib/block_scout_web/templates/address/_tabs.html.eex:31
#: lib/block_scout_web/templates/address_validation/index.html.eex:13 #: lib/block_scout_web/templates/address_validation/index.html.eex:13
#: lib/block_scout_web/views/address_view.ex:307 #: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated" msgid "Blocks Validated"
msgstr "" msgstr ""
@ -1800,18 +1800,18 @@ msgstr ""
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:303 #: lib/block_scout_web/views/address_view.ex:307
msgid "Code" msgid "Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:20 #: lib/block_scout_web/templates/address/_tabs.html.eex:20
#: lib/block_scout_web/views/address_view.ex:306 #: lib/block_scout_web/views/address_view.ex:310
msgid "Coin Balance History" msgid "Coin Balance History"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/views/address_view.ex:304 #: lib/block_scout_web/views/address_view.ex:308
msgid "Decompiled Code" msgid "Decompiled Code"
msgstr "" msgstr ""
@ -1820,7 +1820,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:19 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:19
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6
#: lib/block_scout_web/views/address_view.ex:302 #: lib/block_scout_web/views/address_view.ex:306
#: lib/block_scout_web/views/transaction_view.ex:314 #: lib/block_scout_web/views/transaction_view.ex:314
msgid "Internal Transactions" msgid "Internal Transactions"
msgstr "" msgstr ""
@ -1830,7 +1830,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_logs/index.html.eex:8 #: lib/block_scout_web/templates/address_logs/index.html.eex:8
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8
#: lib/block_scout_web/views/address_view.ex:308 #: lib/block_scout_web/views/address_view.ex:312
#: lib/block_scout_web/views/transaction_view.ex:315 #: lib/block_scout_web/views/transaction_view.ex:315
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
@ -1838,7 +1838,7 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:56 #: lib/block_scout_web/templates/address/_tabs.html.eex:56
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:25 #: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:25
#: lib/block_scout_web/views/address_view.ex:305 #: lib/block_scout_web/views/address_view.ex:309
#: lib/block_scout_web/views/tokens/overview_view.ex:37 #: lib/block_scout_web/views/tokens/overview_view.ex:37
msgid "Read Contract" msgid "Read Contract"
msgstr "" msgstr ""
@ -1847,7 +1847,7 @@ msgstr ""
#: lib/block_scout_web/templates/address/_tabs.html.eex:8 #: lib/block_scout_web/templates/address/_tabs.html.eex:8
#: lib/block_scout_web/templates/address_token/index.html.eex:8 #: lib/block_scout_web/templates/address_token/index.html.eex:8
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9
#: lib/block_scout_web/views/address_view.ex:300 #: lib/block_scout_web/views/address_view.ex:304
msgid "Tokens" msgid "Tokens"
msgstr "" msgstr ""
@ -1858,6 +1858,6 @@ msgstr ""
#: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18
#: lib/block_scout_web/templates/chain/show.html.eex:145 #: lib/block_scout_web/templates/chain/show.html.eex:145
#: lib/block_scout_web/templates/layout/_topnav.html.eex:50 #: lib/block_scout_web/templates/layout/_topnav.html.eex:50
#: lib/block_scout_web/views/address_view.ex:301 #: lib/block_scout_web/views/address_view.ex:305
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""

@ -1027,8 +1027,8 @@ msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:31 #: lib/block_scout_web/templates/chain/show.html.eex:31
#: lib/block_scout_web/templates/layout/app.html.eex:60 #: lib/block_scout_web/templates/layout/app.html.eex:60
#: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:125
#: lib/block_scout_web/views/address_view.ex:121 #: lib/block_scout_web/views/address_view.ex:125
msgid "Market Cap" msgid "Market Cap"
msgstr "" msgstr ""
@ -1478,7 +1478,7 @@ msgid "Transaction Speed"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tile.html.eex:31 #: lib/block_scout_web/templates/address/_tile.html.eex:33
msgid "Transactions sent" msgid "Transactions sent"
msgstr "" msgstr ""
@ -1787,10 +1787,10 @@ msgstr ""
msgid "Copy Txn Input" msgid "Copy Txn Input"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:31 #: lib/block_scout_web/templates/address/_tabs.html.eex:31
#: lib/block_scout_web/templates/address_validation/index.html.eex:13 #: lib/block_scout_web/templates/address_validation/index.html.eex:13
#: lib/block_scout_web/views/address_view.ex:307 #: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated" msgid "Blocks Validated"
msgstr "" msgstr ""
@ -1800,27 +1800,27 @@ msgstr ""
#: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187 #: lib/block_scout_web/templates/api_docs/_action_tile.html.eex:187
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:126
#: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149 #: lib/block_scout_web/templates/api_docs/_eth_rpc_item.html.eex:149
#: lib/block_scout_web/views/address_view.ex:303 #: lib/block_scout_web/views/address_view.ex:307
msgid "Code" msgid "Code"
msgstr "" msgstr ""
#, elixir-format #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:20 #: lib/block_scout_web/templates/address/_tabs.html.eex:20
#: lib/block_scout_web/views/address_view.ex:306 #: lib/block_scout_web/views/address_view.ex:310
msgid "Coin Balance History" msgid "Coin Balance History"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/views/address_view.ex:304 #: lib/block_scout_web/views/address_view.ex:308
msgid "Decompiled Code" msgid "Decompiled Code"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:14 #: lib/block_scout_web/templates/address/_tabs.html.eex:14
#: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:19 #: lib/block_scout_web/templates/address_internal_transaction/index.html.eex:19
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:11 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:11
#: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6 #: lib/block_scout_web/templates/transaction_internal_transaction/index.html.eex:6
#: lib/block_scout_web/views/address_view.ex:302 #: lib/block_scout_web/views/address_view.ex:306
#: lib/block_scout_web/views/transaction_view.ex:314 #: lib/block_scout_web/views/transaction_view.ex:314
msgid "Internal Transactions" msgid "Internal Transactions"
msgstr "" msgstr ""
@ -1830,34 +1830,34 @@ msgstr ""
#: lib/block_scout_web/templates/address_logs/index.html.eex:8 #: lib/block_scout_web/templates/address_logs/index.html.eex:8
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:17 #: lib/block_scout_web/templates/transaction/_tabs.html.eex:17
#: lib/block_scout_web/templates/transaction_log/index.html.eex:8 #: lib/block_scout_web/templates/transaction_log/index.html.eex:8
#: lib/block_scout_web/views/address_view.ex:308 #: lib/block_scout_web/views/address_view.ex:312
#: lib/block_scout_web/views/transaction_view.ex:315 #: lib/block_scout_web/views/transaction_view.ex:315
msgid "Logs" msgid "Logs"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:56 #: lib/block_scout_web/templates/address/_tabs.html.eex:56
#: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:25 #: lib/block_scout_web/templates/tokens/overview/_tabs.html.eex:25
#: lib/block_scout_web/views/address_view.ex:305 #: lib/block_scout_web/views/address_view.ex:309
#: lib/block_scout_web/views/tokens/overview_view.ex:37 #: lib/block_scout_web/views/tokens/overview_view.ex:37
msgid "Read Contract" msgid "Read Contract"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:8 #: lib/block_scout_web/templates/address/_tabs.html.eex:8
#: lib/block_scout_web/templates/address_token/index.html.eex:8 #: lib/block_scout_web/templates/address_token/index.html.eex:8
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9 #: lib/block_scout_web/templates/address_token_transfer/index.html.eex:9
#: lib/block_scout_web/views/address_view.ex:300 #: lib/block_scout_web/views/address_view.ex:304
msgid "Tokens" msgid "Tokens"
msgstr "" msgstr ""
#, elixir-format, fuzzy #, elixir-format
#: lib/block_scout_web/templates/address/_tabs.html.eex:3 #: lib/block_scout_web/templates/address/_tabs.html.eex:3
#: lib/block_scout_web/templates/address_transaction/index.html.eex:15 #: lib/block_scout_web/templates/address_transaction/index.html.eex:15
#: lib/block_scout_web/templates/block_transaction/index.html.eex:10 #: lib/block_scout_web/templates/block_transaction/index.html.eex:10
#: lib/block_scout_web/templates/block_transaction/index.html.eex:18 #: lib/block_scout_web/templates/block_transaction/index.html.eex:18
#: lib/block_scout_web/templates/chain/show.html.eex:145 #: lib/block_scout_web/templates/chain/show.html.eex:145
#: lib/block_scout_web/templates/layout/_topnav.html.eex:50 #: lib/block_scout_web/templates/layout/_topnav.html.eex:50
#: lib/block_scout_web/views/address_view.ex:301 #: lib/block_scout_web/views/address_view.ex:305
msgid "Transactions" msgid "Transactions"
msgstr "" msgstr ""

Loading…
Cancel
Save