From 11ef5f50993f94d1dafb81a1c9aa3b00161df6a4 Mon Sep 17 00:00:00 2001 From: Ayrat Badykov Date: Mon, 16 Sep 2019 15:42:02 +0300 Subject: [PATCH] add image instance --- apps/block_scout_web/assets/css/app.scss | 1 + .../_erc721_token_image_container.scss | 10 +++++++ .../lib/block_scout_web/csp_header.ex | 2 +- .../instance/overview/_details.html.eex | 30 ++++--------------- .../tokens/instance/transfer/index.html.eex | 1 + .../views/tokens/instance/overview_view.ex | 10 +++++++ apps/explorer/lib/explorer/chain.ex | 1 + .../lib/explorer/chain/token_transfer.ex | 8 +++++ 8 files changed, 38 insertions(+), 25 deletions(-) create mode 100644 apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss diff --git a/apps/block_scout_web/assets/css/app.scss b/apps/block_scout_web/assets/css/app.scss index 4563ec33d5..93cc75e899 100644 --- a/apps/block_scout_web/assets/css/app.scss +++ b/apps/block_scout_web/assets/css/app.scss @@ -114,6 +114,7 @@ $fa-font-path: "~@fortawesome/fontawesome-free/webfonts"; @import "components/radio_big"; @import "components/btn_no_border"; @import "components/custom_tooltips_block_details"; +@import "components/_erc721_token_image_container"; @import "theme/dark-theme"; diff --git a/apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss b/apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss new file mode 100644 index 0000000000..77ffc633fe --- /dev/null +++ b/apps/block_scout_web/assets/css/components/_erc721_token_image_container.scss @@ -0,0 +1,10 @@ +/* ERC721 image block */ +.erc721-image { + display: flex; + justify-content: center; +} + + .erc721-image img { + height: 200px; +} +/* ERC721 image block end */ diff --git a/apps/block_scout_web/lib/block_scout_web/csp_header.ex b/apps/block_scout_web/lib/block_scout_web/csp_header.ex index 199ee9f189..ace7894e86 100644 --- a/apps/block_scout_web/lib/block_scout_web/csp_header.ex +++ b/apps/block_scout_web/lib/block_scout_web/csp_header.ex @@ -15,7 +15,7 @@ defmodule BlockScoutWeb.CSPHeader do default-src 'self';\ script-src 'self' 'unsafe-inline' 'unsafe-eval';\ style-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.googleapis.com;\ - img-src 'self' 'unsafe-inline' 'unsafe-eval' data:;\ + img-src 'self' 'unsafe-inline' 'unsafe-eval' data: https:;\ font-src 'self' 'unsafe-inline' 'unsafe-eval' https://fonts.gstatic.com data:;\ " }) diff --git a/apps/block_scout_web/lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex index 25a3c4f7ab..d8458a603e 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/tokens/instance/overview/_details.html.eex @@ -67,34 +67,16 @@ - <%= if total_supply?(@token) do %> -
-
-
-

<%= gettext "Total Supply" %>

-
-

- <%= if decimals?(@token) do %> - <%= format_according_to_decimals(@token.total_supply, @token.decimals) %> - <% else %> - <%= format_integer_to_currency(@token.total_supply) %> - <% end %> <%= @token.symbol %> -

- <%= if @token.usd_value do %> -
- - | - -
- <% else %> -
- <% end %> -
+
+
+
+
+ />
- <% end %> +