Display unit price similar to Etherscan

pull/1113/head
l1h3r 6 years ago
parent 495ffb2ddb
commit 71d590d190
  1. 21
      apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex
  2. 11
      apps/block_scout_web/priv/gettext/default.pot
  3. 11
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -4,24 +4,13 @@
<span></span>
<div class="text-right">
<h3 class="text-white" data-test="address_balance"><%= balance(@address) %></h3>
<div class="text-white">
<span><%= gettext("Price") %> - </span>
<span class="text-white text-faded">
<span
class="text-faded"
data-wei-value="<%= if @address.fetched_coin_balance, do: @address.fetched_coin_balance.value %>"
data-usd-exchange-rate="<%= @exchange_rate.usd_value %>"
></span>
</div>
<div class="text-white">
<span><%= gettext("Unit Price") %> - </span>
<span
class="text-faded"
data-wei-value="<%= Explorer.Chain.Wei.from(Decimal.new(1), :ether).value %>"
data-usd-exchange-rate="<%= @exchange_rate.usd_value %>"
></span>
</div>
data-usd-exchange-rate="<%= @exchange_rate.usd_value %>">
</span>
<small>(@ <%= @exchange_rate.usd_value %>/<%= gettext("Ether") %>)</small>
</span>
<div class="mt-3" data-token-balance-dropdown data-api_path="<%= address_token_balance_path(BlockScoutWeb.Endpoint, :index, @address.hash) %>">
<div data-loading class="mb-0 text-white text-faded">

@ -387,7 +387,7 @@ msgid "Enter the Solidity Contract Code below"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:36
#: lib/block_scout_web/templates/address/_balance_card.html.eex:25
msgid "Error trying to fetch balances."
msgstr ""
@ -402,6 +402,7 @@ msgid "Error: (Awaiting internal transactions for reason)"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:12
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:16
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:19
#: lib/block_scout_web/templates/transaction/_tile.html.eex:26
@ -421,7 +422,7 @@ msgid "Execute"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:32
#: lib/block_scout_web/templates/address/_balance_card.html.eex:21
msgid "Fetching tokens..."
msgstr ""
@ -699,7 +700,6 @@ msgid "Position %{index}"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:9
#: lib/block_scout_web/templates/chain/show.html.eex:11
#: lib/block_scout_web/templates/layout/app.html.eex:50
msgid "Price"
@ -1323,8 +1323,3 @@ msgstr ""
#: lib/block_scout_web/views/internal_transaction_view.ex:24
msgid "Static Call"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:18
msgid "Unit Price"
msgstr ""

@ -387,7 +387,7 @@ msgid "Enter the Solidity Contract Code below"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:36
#: lib/block_scout_web/templates/address/_balance_card.html.eex:25
msgid "Error trying to fetch balances."
msgstr ""
@ -402,6 +402,7 @@ msgid "Error: (Awaiting internal transactions for reason)"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:12
#: lib/block_scout_web/templates/internal_transaction/_tile.html.eex:16
#: lib/block_scout_web/templates/transaction/_pending_tile.html.eex:19
#: lib/block_scout_web/templates/transaction/_tile.html.eex:26
@ -421,7 +422,7 @@ msgid "Execute"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:32
#: lib/block_scout_web/templates/address/_balance_card.html.eex:21
msgid "Fetching tokens..."
msgstr ""
@ -699,7 +700,6 @@ msgid "Position %{index}"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:9
#: lib/block_scout_web/templates/chain/show.html.eex:11
#: lib/block_scout_web/templates/layout/app.html.eex:50
msgid "Price"
@ -1323,8 +1323,3 @@ msgstr ""
#: lib/block_scout_web/views/internal_transaction_view.ex:24
msgid "Static Call"
msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/address/_balance_card.html.eex:18
msgid "Unit Price"
msgstr ""

Loading…
Cancel
Save