From 541febb61528c86aa10b67044a44b5ef06adf0d7 Mon Sep 17 00:00:00 2001 From: nikitosing Date: Tue, 31 Aug 2021 11:54:08 +0300 Subject: [PATCH] Fix solid outputs on contract read page --- CHANGELOG.md | 1 + .../templates/smart_contract/_functions.html.eex | 5 +++-- apps/block_scout_web/priv/gettext/default.pot | 4 ++-- apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po | 4 ++-- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 36cf2acfd4..82ca99da9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - [#4579](https://github.com/blockscout/blockscout/pull/4579) - Write contract page: Resize inputs; Improve multiplier selector ### Fixes +- [#4589](https://github.com/blockscout/blockscout/pull/4589) - Fix solid outputs on contract read page - [#4586](https://github.com/blockscout/blockscout/pull/4586) - Fix floating tooltips on the token transfer family blocks - [#4587](https://github.com/blockscout/blockscout/pull/4587) - Enable navbar menu on Search results page - [#4582](https://github.com/blockscout/blockscout/pull/4582) - Fix NaN input on write contract page diff --git a/apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex index b12a999cb6..7c034673a3 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/smart_contract/_functions.html.eex @@ -107,12 +107,13 @@ <% else %> <%= if outputs?(function["outputs"]) do %> - <%= for output <- function["outputs"] do %> + <% length = Enum.count(function["outputs"]) %> + <%= for {output, index} <- Enum.with_index(function["outputs"]) do %> <%= if address?(output["type"]) do %>
<%= link( output["value"], - to: address_path(@conn, :show, output["value"])) %> + to: address_path(@conn, :show, output["value"])) %><%= if length > 1 and index < length - 1 do %>, <% end %>
<% else %> <%= if output["type"] == "uint256" do %> diff --git a/apps/block_scout_web/priv/gettext/default.pot b/apps/block_scout_web/priv/gettext/default.pot index dabb7bde29..191ca194e4 100644 --- a/apps/block_scout_web/priv/gettext/default.pot +++ b/apps/block_scout_web/priv/gettext/default.pot @@ -1006,7 +1006,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:90 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:90 -#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:125 +#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:126 msgid "ETH" msgstr "" @@ -2841,7 +2841,7 @@ msgid "View transaction %{transaction} on %{subnetwork}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:124 +#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:125 msgid "WEI" 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 dabb7bde29..191ca194e4 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 @@ -1006,7 +1006,7 @@ msgstr "" #, elixir-format #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:90 #: lib/block_scout_web/templates/smart_contract/_functions.html.eex:90 -#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:125 +#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:126 msgid "ETH" msgstr "" @@ -2841,7 +2841,7 @@ msgid "View transaction %{transaction} on %{subnetwork}" msgstr "" #, elixir-format -#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:124 +#: lib/block_scout_web/templates/smart_contract/_functions.html.eex:125 msgid "WEI" msgstr ""