Merge pull request #451 from poanetwork/transaction-detail-#369
Transaction detail #369pull/475/head
commit
2582d0504b
@ -1,4 +1,4 @@ |
|||||||
<span class="<%= if @contract do %>contract-address<% end %>"> |
<span class="<%= if @contract do %>contract-address<% end %>"> |
||||||
<span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span> |
<span class="d-none d-md-none d-lg-inline"><%= @address_hash %></span> |
||||||
<span class="d-md-block d-lg-none "><%= ExplorerWeb.AddressView.trimmed_hash(@address_hash) %></span> |
<span class="d-md-inline-block d-lg-none "><%= ExplorerWeb.AddressView.trimmed_hash(@address_hash) %></span> |
||||||
</span> |
</span> |
||||||
|
@ -0,0 +1,20 @@ |
|||||||
|
<div class="tile tile-type-internal-transaction fade-in" data-test="internal_transaction" data-internal-transaction-id="<%= @internal_transaction.id %>"> |
||||||
|
<div class="row justify-content-end"> |
||||||
|
<div class="col-md-3 col-lg-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label"> |
||||||
|
<%= gettext("Internal Transaction") %> |
||||||
|
</div> |
||||||
|
<div class="col-md-9 col-lg-10 d-flex flex-column text-nowrap"> |
||||||
|
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @internal_transaction.transaction_hash %> |
||||||
|
<span> |
||||||
|
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@internal_transaction.from_address), locale: @locale %> |
||||||
|
→ |
||||||
|
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.InternalTransactionView.to_address_hash(@internal_transaction), contract: ExplorerWeb.AddressView.contract?(@internal_transaction.to_address), locale: @locale %> |
||||||
|
</span> |
||||||
|
|
||||||
|
<span class="tile-title text-truncate"> |
||||||
|
<%= ExplorerWeb.TransactionView.value(@internal_transaction, include_label: false) %> |
||||||
|
<%= gettext "Ether" %> |
||||||
|
</span> |
||||||
|
</div> |
||||||
|
</div> |
||||||
|
</div> |
@ -1,83 +1,72 @@ |
|||||||
<section class="container-fluid"> |
<section class="container"> |
||||||
|
|
||||||
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> |
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> |
||||||
|
|
||||||
<section> |
<div class="card"> |
||||||
<div class="card"> |
<div class="card-header"> |
||||||
<div class="card-header"> |
|
||||||
<ul class="nav nav-tabs card-header-tabs"> |
<!-- DESKTOP TAB NAV --> |
||||||
<li class="nav-item"> |
<ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex"> |
||||||
<%= link( |
<li class="nav-item"> |
||||||
gettext("Internal Transactions"), |
<%= link( |
||||||
class: "nav-link active", |
gettext("Internal Transactions"), |
||||||
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
class: "nav-link active", |
||||||
) %> |
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||||
</li> |
) %> |
||||||
<li class="nav-item"> |
</li> |
||||||
<%= link( |
<li class="nav-item"> |
||||||
gettext("Logs"), |
<%= link( |
||||||
class: "nav-link", |
gettext("Logs"), |
||||||
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction), |
class: "nav-link", |
||||||
"data-test": "transaction_logs_link" |
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction), |
||||||
) %> |
"data-test": "transaction_logs_link" |
||||||
</li> |
) %> |
||||||
</ul> |
</li> |
||||||
</div> |
</ul> |
||||||
<div class="card-body"> |
|
||||||
<%= if Enum.count(@internal_transactions) > 0 do %> |
<!-- MOBILE DROPDOWN NAV --> |
||||||
<table class="table table-responsive-sm table-font"> |
<ul class="nav nav-tabs card-header-tabs d-md-none"> |
||||||
<thead> |
<li class="nav-item dropdown flex-fill text-center"> |
||||||
<th><%= gettext "Type" %></th> |
<a class="nav-link active dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><%= gettext("Internal Transactions") %></a> |
||||||
<th><%= gettext "From" %></th> |
<div class="dropdown-menu"> |
||||||
<th><%= gettext "To" %></th> |
<%= link( |
||||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
gettext("Internal Transactions"), |
||||||
<th><%= gettext "Gas Used" %></th> |
class: "dropdown-item", |
||||||
</thead> |
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||||
|
) %> |
||||||
|
<%= link( |
||||||
|
gettext("Logs"), |
||||||
|
class: "dropdown-item", |
||||||
|
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction), |
||||||
|
"data-test": "transaction_logs_link" |
||||||
|
) %> |
||||||
|
</div> |
||||||
|
</li> |
||||||
|
</ul> |
||||||
|
</div> |
||||||
|
<div class="card-body"> |
||||||
|
<h2 class="card-title"><%= gettext "Internal Transactions" %></h2> |
||||||
|
<%= if Enum.count(@internal_transactions) > 0 do %> |
||||||
<%= for internal_transaction <- @internal_transactions do %> |
<%= for internal_transaction <- @internal_transactions do %> |
||||||
<tgroup> |
<%= render "_internal_transaction.html", locale: @locale, internal_transaction: internal_transaction %> |
||||||
<tr> |
|
||||||
<td><%= internal_transaction.type %></td> |
|
||||||
<td> |
|
||||||
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: internal_transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(internal_transaction.from_address), locale: @locale %> |
|
||||||
</td> |
|
||||||
<td> |
|
||||||
<%= if ExplorerWeb.InternalTransactionView.create?(internal_transaction) do %> |
|
||||||
<i class="fas fa-plus-square"></i> |
|
||||||
<%= link( |
|
||||||
gettext("Contract Creation"), |
|
||||||
class: "transaction__link", |
|
||||||
"data-address-hash": internal_transaction.created_contract_address_hash, |
|
||||||
to: address_path(ExplorerWeb.Endpoint, :show, @locale, internal_transaction.created_contract_address_hash), |
|
||||||
title: internal_transaction.created_contract_address_hash |
|
||||||
) %> |
|
||||||
<% else %> |
|
||||||
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: internal_transaction.to_address_hash, contract: ExplorerWeb.AddressView.contract?(internal_transaction.to_address), locale: @locale %> |
|
||||||
<% end %> |
|
||||||
</td> |
|
||||||
<td><%= ExplorerWeb.TransactionView.value(internal_transaction, include_label: false) %></td> |
|
||||||
<td><%= ExplorerWeb.TransactionView.gas(internal_transaction) %></td> |
|
||||||
</tr> |
|
||||||
</tgroup> |
|
||||||
<% end %> |
<% end %> |
||||||
</table> |
<% else %> |
||||||
<% else %> |
<div class="tile tile-muted text-center"> |
||||||
<p><%= gettext "There are no Internal Transactions" %></p> |
<span><%= gettext "There are no internal transactions for this transaction." %></span> |
||||||
<% end %> |
</div> |
||||||
|
<% end %> |
||||||
|
</div> |
||||||
</div> |
</div> |
||||||
</div> |
<%= if @next_page_params do %> |
||||||
|
<%= link( |
||||||
<%= if @next_page_params do %> |
gettext("Newer"), |
||||||
<%= link( |
class: "button button--secondary button--sm u-float-right mt-3", |
||||||
gettext("Newer"), |
to: transaction_internal_transaction_path( |
||||||
class: "button button--secondary button--sm u-float-right mt-3", |
@conn, |
||||||
to: transaction_internal_transaction_path( |
:index, |
||||||
@conn, |
@conn.assigns.locale, |
||||||
:index, |
@transaction, |
||||||
@conn.assigns.locale, |
@next_page_params |
||||||
@transaction, |
) |
||||||
@next_page_params |
) %> |
||||||
) |
<% end %> |
||||||
) %> |
</section> |
||||||
<% end %> |
|
||||||
</section> |
|
||||||
</section> |
|
||||||
|
Loading…
Reference in new issue