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

@ -50,7 +50,9 @@
<% end %> <% end %>
</span> </span>
</div> </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> <hr>
<!-- Block Hash --> <!-- Block Hash -->
<dl class="row"> <dl class="row">

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

Loading…
Cancel
Save