Fix display of verification alternatives in the tx details page

pull/1889/head
Victor Baranov 6 years ago
parent 152d4995c1
commit 6288d8ea4e
  1. 8
      apps/block_scout_web/lib/block_scout_web/templates/address/_verify_other_explorers.html.eex
  2. 4
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex
  3. 14
      apps/block_scout_web/lib/block_scout_web/views/address_view.ex

@ -12,8 +12,8 @@
<div class="verify-other-explorers-cell">
<span class='link'>
<%= link(
address_link_to_other_explorer("https://blockchair.com/ethereum/address/", @address),
to: address_link_to_other_explorer("https://blockchair.com/ethereum/address/", @address)
address_link_to_other_explorer("https://blockchair.com/ethereum/address/", @address, false),
to: address_link_to_other_explorer("https://blockchair.com/ethereum/address/", @address ,true)
) %>
</span>
</div>
@ -27,8 +27,8 @@
<div class="verify-other-explorers-cell right">
<span class='link'>
<%= link(
address_link_to_other_explorer("https://www.etherchain.org/account/", @address),
to: address_link_to_other_explorer("https://www.etherchain.org/account/", @address)
address_link_to_other_explorer("https://www.etherchain.org/account/", @address, false),
to: address_link_to_other_explorer("https://www.etherchain.org/account/", @address, true)
) %>
</span>
</div>

@ -50,7 +50,9 @@
<% end %>
</span>
</div>
<%= render BlockScoutWeb.AddressView, "_verify_other_explorers.html", address: @transaction |> BlockScoutWeb.AddressView.address_partial_selector(:to, nil) |> BlockScoutWeb.RenderHelpers.render_partial() %>
<%= if contract_creation?(@transaction) do %>
<%= render BlockScoutWeb.AddressView, "_verify_other_explorers.html", address: to_address_hash(@transaction) %>
<% end %>
<hr>
<!-- Block Hash -->
<dl class="row">

@ -256,15 +256,19 @@ defmodule BlockScoutWeb.AddressView do
nil
end
def address_link_to_other_explorer(link, address) do
link <> trimmed_hash(address)
def address_link_to_other_explorer(link, address, full) do
if full do
link <> to_string(address)
else
link <> trimmed_hash(address)
end
end
def address_link_to_other_explorer(_, address), do: ""
def address_link_to_other_explorer(_, address, full), do: ""
def address_link_to_other_explorer(_, _), do: ""
def address_link_to_other_explorer(_, _, full), do: ""
def address_link_to_other_explorer(link, _), do: ""
def address_link_to_other_explorer(link, _, full), do: ""
defp matching_address_check(%Address{hash: hash} = current_address, %Address{hash: hash}, contract?, truncate) do
[

Loading…
Cancel
Save