Token image from image as an object

pull/3128/head
Victor Baranov 5 years ago
parent fb38c8ac6b
commit 082d921510
  1. 10
      apps/block_scout_web/lib/block_scout_web/views/tokens/instance/overview_view.ex
  2. 4
      apps/block_scout_web/priv/gettext/default.pot
  3. 4
      apps/block_scout_web/priv/gettext/en/LC_MESSAGES/default.po

@ -26,7 +26,7 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
instance.metadata["image_url"]
instance.metadata && instance.metadata["image"] ->
instance.metadata["image"]
retrieve_image(instance.metadata["image"])
instance.metadata && instance.metadata["properties"]["image"]["description"] ->
instance.metadata["properties"]["image"]["description"]
@ -87,6 +87,14 @@ defmodule BlockScoutWeb.Tokens.Instance.OverviewView do
|> tab_name()
end
defp retrieve_image(image) when is_map(image) do
image["description"]
end
defp retrieve_image(image) do
image
end
defp tab_name(["token_transfers"]), do: gettext("Token Transfers")
defp tab_name(["metadata"]), do: gettext("Metadata")
end

@ -904,7 +904,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7
#: lib/block_scout_web/views/address_view.ex:325
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:90
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:98
#: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:390
msgid "Token Transfers"
@ -1779,7 +1779,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18
#: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:91
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:99
msgid "Metadata"
msgstr ""

@ -904,7 +904,7 @@ msgstr ""
#: lib/block_scout_web/templates/transaction/_tabs.html.eex:4
#: lib/block_scout_web/templates/transaction_token_transfer/index.html.eex:7
#: lib/block_scout_web/views/address_view.ex:325
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:90
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:98
#: lib/block_scout_web/views/tokens/overview_view.ex:35
#: lib/block_scout_web/views/transaction_view.ex:390
msgid "Token Transfers"
@ -1779,7 +1779,7 @@ msgstr ""
#, elixir-format
#: lib/block_scout_web/templates/tokens/instance/metadata/index.html.eex:18
#: lib/block_scout_web/templates/tokens/instance/overview/_tabs.html.eex:10
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:91
#: lib/block_scout_web/views/tokens/instance/overview_view.ex:99
msgid "Metadata"
msgstr ""

Loading…
Cancel
Save