add block count to chain show view

pull/1813/head
saneery 6 years ago
parent 4862f9dd40
commit 0c61d26c6a
  1. 4
      apps/block_scout_web/lib/block_scout_web/controllers/chain_controller.ex
  2. 8
      apps/block_scout_web/lib/block_scout_web/templates/chain/show.html.eex
  3. 25
      apps/block_scout_web/priv/gettext/default.pot
  4. 25
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -11,6 +11,7 @@ defmodule BlockScoutWeb.ChainController do
def show(conn, _params) do
transaction_estimated_count = Chain.transaction_estimated_count()
block_count = Chain.block_count()
exchange_rate = Market.get_exchange_rate(Explorer.coin()) || Token.null()
@ -22,7 +23,8 @@ defmodule BlockScoutWeb.ChainController do
exchange_rate: exchange_rate,
chart_data_path: market_history_chart_path(conn, :show),
transaction_estimated_count: transaction_estimated_count,
transactions_path: recent_transactions_path(conn, :index)
transactions_path: recent_transactions_path(conn, :index),
block_count: block_count
)
end

@ -53,6 +53,14 @@
<%= Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###") %>
</span>
</div>
<div class="dashboard-banner-network-stats-item">
<span class="dashboard-banner-network-stats-label">
<%= gettext "Total blocks" %>
</span>
<span class="dashboard-banner-network-stats-value" data-selector="block-count">
<%= Cldr.Number.to_string!(@block_count, format: "#,###") %>
</span>
</div>
<div class="dashboard-banner-network-stats-item">
<span class="dashboard-banner-network-stats-label">
<%= gettext "Wallet addresses" %>

@ -175,7 +175,7 @@ msgid "BlockScout provides analytics data, API, and Smart Contract tools for the
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:72
#: lib/block_scout_web/templates/chain/show.html.eex:80
#: lib/block_scout_web/templates/layout/_topnav.html.eex:16
#: lib/block_scout_web/templates/layout/_topnav.html.eex:20
msgid "Blocks"
@ -560,7 +560,7 @@ msgid "More internal transactions have come in"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:96
#: lib/block_scout_web/templates/chain/show.html.eex:104
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:14
#: lib/block_scout_web/templates/transaction/index.html.eex:14
msgid "More transactions have come in"
@ -957,7 +957,7 @@ msgstr ""
#: lib/block_scout_web/templates/block_transaction/index.html.eex:23
#: lib/block_scout_web/templates/block_transaction/index.html.eex:26
#: lib/block_scout_web/templates/block_transaction/index.html.eex:35
#: lib/block_scout_web/templates/chain/show.html.eex:93
#: lib/block_scout_web/templates/chain/show.html.eex:101
#: lib/block_scout_web/templates/layout/_topnav.html.eex:35
#: lib/block_scout_web/views/address_view.ex:294
msgid "Transactions"
@ -1031,12 +1031,12 @@ msgid "Verify & publish"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:71
#: lib/block_scout_web/templates/chain/show.html.eex:79
msgid "View All Blocks →"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:92
#: lib/block_scout_web/templates/chain/show.html.eex:100
msgid "View All Transactions →"
msgstr ""
@ -1076,7 +1076,7 @@ msgid "WEI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:58
#: lib/block_scout_web/templates/chain/show.html.eex:66
msgid "Wallet addresses"
msgstr ""
@ -1160,8 +1160,8 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19
#: lib/block_scout_web/templates/address_validation/index.html.eex:63
#: lib/block_scout_web/templates/address_validation/index.html.eex:82
#: lib/block_scout_web/templates/chain/show.html.eex:84
#: lib/block_scout_web/templates/chain/show.html.eex:110
#: lib/block_scout_web/templates/chain/show.html.eex:92
#: lib/block_scout_web/templates/chain/show.html.eex:118
#: lib/block_scout_web/templates/tokens/read_contract/index.html.eex:24
msgid "Loading..."
msgstr ""
@ -1371,7 +1371,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:26
#: lib/block_scout_web/templates/address_transaction/index.html.eex:55
#: lib/block_scout_web/templates/address_validation/index.html.eex:70
#: lib/block_scout_web/templates/chain/show.html.eex:76
#: lib/block_scout_web/templates/chain/show.html.eex:84
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:23
#: lib/block_scout_web/templates/tokens/holder/index.html.eex:22
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:20
@ -1514,7 +1514,7 @@ msgid "Emission Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:102
#: lib/block_scout_web/templates/chain/show.html.eex:110
msgid "Something went wrong, click to retry."
msgstr ""
@ -1744,3 +1744,8 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/overview.html.eex:165
msgid "ERC-721"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:58
msgid "Total blocks"
msgstr ""

@ -175,7 +175,7 @@ msgid "BlockScout provides analytics data, API, and Smart Contract tools for the
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:72
#: lib/block_scout_web/templates/chain/show.html.eex:80
#: lib/block_scout_web/templates/layout/_topnav.html.eex:16
#: lib/block_scout_web/templates/layout/_topnav.html.eex:20
msgid "Blocks"
@ -560,7 +560,7 @@ msgid "More internal transactions have come in"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:96
#: lib/block_scout_web/templates/chain/show.html.eex:104
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:14
#: lib/block_scout_web/templates/transaction/index.html.eex:14
msgid "More transactions have come in"
@ -957,7 +957,7 @@ msgstr ""
#: lib/block_scout_web/templates/block_transaction/index.html.eex:23
#: lib/block_scout_web/templates/block_transaction/index.html.eex:26
#: lib/block_scout_web/templates/block_transaction/index.html.eex:35
#: lib/block_scout_web/templates/chain/show.html.eex:93
#: lib/block_scout_web/templates/chain/show.html.eex:101
#: lib/block_scout_web/templates/layout/_topnav.html.eex:35
#: lib/block_scout_web/views/address_view.ex:294
msgid "Transactions"
@ -1031,12 +1031,12 @@ msgid "Verify & publish"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:71
#: lib/block_scout_web/templates/chain/show.html.eex:79
msgid "View All Blocks →"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:92
#: lib/block_scout_web/templates/chain/show.html.eex:100
msgid "View All Transactions →"
msgstr ""
@ -1076,7 +1076,7 @@ msgid "WEI"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:58
#: lib/block_scout_web/templates/chain/show.html.eex:66
msgid "Wallet addresses"
msgstr ""
@ -1160,8 +1160,8 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:19
#: lib/block_scout_web/templates/address_validation/index.html.eex:63
#: lib/block_scout_web/templates/address_validation/index.html.eex:82
#: lib/block_scout_web/templates/chain/show.html.eex:84
#: lib/block_scout_web/templates/chain/show.html.eex:110
#: lib/block_scout_web/templates/chain/show.html.eex:92
#: lib/block_scout_web/templates/chain/show.html.eex:118
#: lib/block_scout_web/templates/tokens/read_contract/index.html.eex:24
msgid "Loading..."
msgstr ""
@ -1371,7 +1371,7 @@ msgstr ""
#: lib/block_scout_web/templates/address_token_transfer/index.html.eex:26
#: lib/block_scout_web/templates/address_transaction/index.html.eex:55
#: lib/block_scout_web/templates/address_validation/index.html.eex:70
#: lib/block_scout_web/templates/chain/show.html.eex:76
#: lib/block_scout_web/templates/chain/show.html.eex:84
#: lib/block_scout_web/templates/pending_transaction/index.html.eex:23
#: lib/block_scout_web/templates/tokens/holder/index.html.eex:22
#: lib/block_scout_web/templates/tokens/transfer/index.html.eex:20
@ -1514,7 +1514,7 @@ msgid "Emission Contract"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:102
#: lib/block_scout_web/templates/chain/show.html.eex:110
msgid "Something went wrong, click to retry."
msgstr ""
@ -1744,3 +1744,8 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/overview.html.eex:165
msgid "ERC-721"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/chain/show.html.eex:58
msgid "Total blocks"
msgstr ""

Loading…
Cancel
Save