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="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> |
||||
|
@ -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 %> |
||||
|
||||
<section> |
||||
<div class="card"> |
||||
<div class="card-header"> |
||||
<ul class="nav nav-tabs card-header-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link active", |
||||
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Logs"), |
||||
class: "nav-link", |
||||
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction), |
||||
"data-test": "transaction_logs_link" |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="card-body"> |
||||
<%= if Enum.count(@internal_transactions) > 0 do %> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<th><%= gettext "Type" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
||||
<th><%= gettext "Gas Used" %></th> |
||||
</thead> |
||||
<div class="card"> |
||||
<div class="card-header"> |
||||
|
||||
<!-- DESKTOP TAB NAV --> |
||||
<ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link active", |
||||
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Logs"), |
||||
class: "nav-link", |
||||
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction), |
||||
"data-test": "transaction_logs_link" |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
|
||||
<!-- MOBILE DROPDOWN NAV --> |
||||
<ul class="nav nav-tabs card-header-tabs d-md-none"> |
||||
<li class="nav-item dropdown flex-fill text-center"> |
||||
<a class="nav-link active dropdown-toggle" data-toggle="dropdown" href="#" role="button" aria-haspopup="true" aria-expanded="false"><%= gettext("Internal Transactions") %></a> |
||||
<div class="dropdown-menu"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "dropdown-item", |
||||
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 %> |
||||
<tgroup> |
||||
<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> |
||||
<%= render "_internal_transaction.html", locale: @locale, internal_transaction: internal_transaction %> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no Internal Transactions" %></p> |
||||
<% end %> |
||||
<% else %> |
||||
<div class="tile tile-muted text-center"> |
||||
<span><%= gettext "There are no internal transactions for this transaction." %></span> |
||||
</div> |
||||
<% end %> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<%= if @next_page_params do %> |
||||
<%= link( |
||||
gettext("Newer"), |
||||
class: "button button--secondary button--sm u-float-right mt-3", |
||||
to: transaction_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@transaction, |
||||
@next_page_params |
||||
) |
||||
) %> |
||||
<% end %> |
||||
</section> |
||||
</section> |
||||
<%= if @next_page_params do %> |
||||
<%= link( |
||||
gettext("Newer"), |
||||
class: "button button--secondary button--sm u-float-right mt-3", |
||||
to: transaction_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@transaction, |
||||
@next_page_params |
||||
) |
||||
) %> |
||||
<% end %> |
||||
</section> |
||||
|
Loading…
Reference in new issue