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. 14
      apps/block_scout_web/lib/block_scout_web/templates/address/_tile.html.eex
  4. 80
      apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex
  5. 12
      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
- [#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
- [#2808](https://github.com/poanetwork/blockscout/pull/2808) - Add tooltip for tx input
- [#2807](https://github.com/poanetwork/blockscout/pull/2807) - 422 page

@ -11,7 +11,8 @@ config :block_scout_web,
ecto_repos: [Explorer.Repo],
version: System.get_env("BLOCKSCOUT_VERSION"),
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,
network: System.get_env("NETWORK"),

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

@ -4,46 +4,48 @@
<h1 class="card-title"><%= gettext "Addresses" %></h1>
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
<div class="addresses-table-container">
<div class="stakes-table-container">
<table>
<thead>
<tr>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
&nbsp;
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Address
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Balance
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Percentage
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Txn Count
</div>
</th>
</tr>
</thead>
<tbody data-items data-selector="top-addresses-list">
<%= render BlockScoutWeb.CommonComponentsView, "_table-loader.html" %>
</tbody>
</table>
<div class="addresses-table-container">
<div class="stakes-table-container">
<table>
<thead>
<tr>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
&nbsp;
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Address
</div>
</th>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Balance
</div>
</div>
</th>
<%= if balance_percentage_enabled?() do %>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Percentage
</div>
</th>
<% end %>
<th class="stakes-table-th">
<div class="stakes-table-th-content">
Txn Count
</div>
</th>
</tr>
</thead>
<tbody data-items data-selector="top-addresses-list">
<%= render BlockScoutWeb.CommonComponentsView, "_table-loader.html" %>
</tbody>
</table>
</div>
</div>
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "bottom", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true, data_prev_page_button: true %>
</div>
</div>

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

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

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

@ -1027,8 +1027,8 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:31
#: 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:121
#: lib/block_scout_web/views/address_view.ex:125
#: lib/block_scout_web/views/address_view.ex:125
msgid "Market Cap"
msgstr ""
@ -1478,7 +1478,7 @@ msgid "Transaction Speed"
msgstr ""
#, 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"
msgstr ""
@ -1790,7 +1790,7 @@ msgstr ""
#, elixir-format
#: 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/views/address_view.ex:307
#: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated"
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/_eth_rpc_item.html.eex:126
#: 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"
msgstr ""
#, elixir-format
#: 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"
msgstr ""
#, elixir-format
#: lib/block_scout_web/views/address_view.ex:304
#: lib/block_scout_web/views/address_view.ex:308
msgid "Decompiled Code"
msgstr ""
@ -1820,7 +1820,7 @@ msgstr ""
#: 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_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
msgid "Internal Transactions"
msgstr ""
@ -1830,7 +1830,7 @@ msgstr ""
#: 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_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
msgid "Logs"
msgstr ""
@ -1838,7 +1838,7 @@ msgstr ""
#, elixir-format
#: 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/views/address_view.ex:305
#: lib/block_scout_web/views/address_view.ex:309
#: lib/block_scout_web/views/tokens/overview_view.ex:37
msgid "Read Contract"
msgstr ""
@ -1847,7 +1847,7 @@ msgstr ""
#: 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_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"
msgstr ""
@ -1858,6 +1858,6 @@ msgstr ""
#: 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/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"
msgstr ""

@ -1027,8 +1027,8 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:31
#: 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:121
#: lib/block_scout_web/views/address_view.ex:125
#: lib/block_scout_web/views/address_view.ex:125
msgid "Market Cap"
msgstr ""
@ -1478,7 +1478,7 @@ msgid "Transaction Speed"
msgstr ""
#, 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"
msgstr ""
@ -1787,10 +1787,10 @@ msgstr ""
msgid "Copy Txn Input"
msgstr ""
#, elixir-format, fuzzy
#, elixir-format
#: 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/views/address_view.ex:307
#: lib/block_scout_web/views/address_view.ex:311
msgid "Blocks Validated"
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/_eth_rpc_item.html.eex:126
#: 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"
msgstr ""
#, elixir-format
#: 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"
msgstr ""
#, elixir-format, fuzzy
#: lib/block_scout_web/views/address_view.ex:304
#, elixir-format
#: lib/block_scout_web/views/address_view.ex:308
msgid "Decompiled Code"
msgstr ""
#, elixir-format, fuzzy
#, elixir-format
#: 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/transaction/_tabs.html.eex:11
#: 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
msgid "Internal Transactions"
msgstr ""
@ -1830,34 +1830,34 @@ msgstr ""
#: 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_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
msgid "Logs"
msgstr ""
#, elixir-format, fuzzy
#, elixir-format
#: 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/views/address_view.ex:305
#: lib/block_scout_web/views/address_view.ex:309
#: lib/block_scout_web/views/tokens/overview_view.ex:37
msgid "Read Contract"
msgstr ""
#, elixir-format, fuzzy
#, elixir-format
#: 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_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"
msgstr ""
#, elixir-format, fuzzy
#, elixir-format
#: 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/block_transaction/index.html.eex:10
#: 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/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"
msgstr ""

Loading…
Cancel
Save