From 0fa216dc357c130303240961f27776a1524dd91c Mon Sep 17 00:00:00 2001 From: saneery Date: Fri, 26 Apr 2019 12:30:31 +0300 Subject: [PATCH] disable usd value in transaction if there no exchange_rate --- .../templates/address/_balance_card.html.eex | 2 +- .../templates/transaction/overview.html.eex | 9 +++++++-- apps/block_scout_web/priv/gettext/default.pot | 6 +++--- .../priv/gettext/en/LC_MESSAGES/default.po | 6 +++--- 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex index 3a2cbedff1..c1e8a32551 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/address/_balance_card.html.eex @@ -9,7 +9,7 @@ - + (@ /<%= gettext("Ether") %>)
diff --git a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex index a3e4490910..9a8cda6407 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex @@ -75,7 +75,7 @@ <%= formatted_fee(@transaction, denomination: :ether) %> <%= if !empty_exchange_rate?(@exchange_rate) do %> - ( data-usd-exchange-rate=<%= @exchange_rate.usd_value %>>) + ( data-usd-exchange-rate=<%= @exchange_rate.usd_value %>>) <% end %> @@ -183,7 +183,12 @@

<%= value(@transaction) %>

- data-usd-exchange-rate=<%= @exchange_rate.usd_value %>> + <%= if !empty_exchange_rate?(@exchange_rate) do %> + + data-usd-exchange-rate=<%= @exchange_rate.usd_value %>> + + <% end %> diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index 395792d02a..fe620604cb 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -431,7 +431,7 @@ msgid "GET" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:199 msgid "Gas" msgstr "" @@ -513,7 +513,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:206 +#: lib/block_scout_web/templates/transaction/overview.html.eex:211 msgid "Limit" msgstr "" @@ -995,7 +995,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:199 +#: lib/block_scout_web/templates/transaction/overview.html.eex:204 msgid "Used" 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 b894c828fd..33682c65e3 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 @@ -431,7 +431,7 @@ msgid "GET" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:194 +#: lib/block_scout_web/templates/transaction/overview.html.eex:199 msgid "Gas" msgstr "" @@ -513,7 +513,7 @@ msgid "Less than" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:206 +#: lib/block_scout_web/templates/transaction/overview.html.eex:211 msgid "Limit" msgstr "" @@ -995,7 +995,7 @@ msgid "Unique Token" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/transaction/overview.html.eex:199 +#: lib/block_scout_web/templates/transaction/overview.html.eex:204 msgid "Used" msgstr ""