Merge pull request #208 from poanetwork/apply-bootstrap-grid-and-components-#123
Apply bootstrap grid and componentspull/213/head
commit
a0302a0f5b
@ -1,25 +1,34 @@ |
||||
<div> |
||||
<section> |
||||
<h1><%= gettext "Address" %></h1> |
||||
<h2 data-test="address_detail_hash"><%= @address %></h2> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="panels__container"> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"><%= gettext "Balance" %></th> |
||||
<td class="u-text-right" data-test="address_balance"> |
||||
<div><%= balance(@address) %></div> |
||||
<div><%= formatted_usd(@address, @exchange_rate) %></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> <%= gettext "Number of Transactions" %></th> |
||||
<td class="u-text-right" data-test="transaction_count"><%= Cldr.Number.to_string!(@transaction_count) %></td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</table> |
||||
<p data-test="address_detail_hash"><%= @address %></p> |
||||
|
||||
<div class="card mb-3"> |
||||
<div class="card-body"> |
||||
<div class="row"> |
||||
<div class="col-sm-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Balance" %> |
||||
</th> |
||||
<td data-test="address_balance"> |
||||
<%= balance(@address) %> </br> |
||||
<%= formatted_usd(@address, @exchange_rate) %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Number of Transactions" %> |
||||
</th> |
||||
<td data-test="transaction_count"> |
||||
<%= Cldr.Number.to_string!(@transaction_count) %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
@ -1,114 +1,121 @@ |
||||
<section class="container__section block"> |
||||
<section class="container-fluid"> |
||||
|
||||
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> |
||||
<div> |
||||
<ul class="nav nav-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link", |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link active", |
||||
"data-test": "internal_transactions_tab_link", |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="dropdown u-float-right u-push-sm"> |
||||
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" |
||||
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
Filter: <%= format_current_filter(@filter) %> |
||||
</button> |
||||
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2"> |
||||
<%= link( |
||||
gettext("All"), |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("To"), |
||||
to: address_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "to" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("From"), |
||||
to: address_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "from" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
|
||||
<section> |
||||
<div class="card"> |
||||
<div class="card-header"> |
||||
<ul class="nav nav-tabs card-header-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link", |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link active", |
||||
"data-test": "internal_transactions_tab_link", |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="card-body"> |
||||
|
||||
<%= if length(@page.entries) > 0 do %> |
||||
<div class="dropdown u-float-right u-push-sm"> |
||||
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" |
||||
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
Filter: <%= format_current_filter(@filter) %> |
||||
</button> |
||||
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2"> |
||||
<%= link( |
||||
gettext("All"), |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("To"), |
||||
to: address_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "to" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("From"), |
||||
to: address_internal_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "from" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
</div> |
||||
</div> |
||||
|
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<th><%= gettext "Parent Tx Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %></th> |
||||
</thead> |
||||
<%= for internal_transaction <- @page do %> |
||||
<tgroup> |
||||
<tr data-test="internal_transaction"> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: internal_transaction.transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link(internal_transaction.transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, internal_transaction.transaction.block) |
||||
) %> |
||||
</td> |
||||
<td><%= ExplorerWeb.BlockView.age(internal_transaction.transaction.block) %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: internal_transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: internal_transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(internal_transaction) %></td> |
||||
</tr> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no Internal Transactions" %></p> |
||||
<% end %> |
||||
</div> |
||||
</div> |
||||
<div class="panels__container"> |
||||
<%= if length(@page.entries) > 0 do %> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<th><%= gettext "Parent Tx Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %></th> |
||||
</thead> |
||||
<%= for internal_transaction <- @page do %> |
||||
<tgroup> |
||||
<tr data-test="internal_transaction"> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: internal_transaction.transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link(internal_transaction.transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, internal_transaction.transaction.block) |
||||
) %> |
||||
</td> |
||||
<td><%= ExplorerWeb.BlockView.age(internal_transaction.transaction.block) %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: internal_transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: internal_transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(internal_transaction) %></td> |
||||
</tr> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no Internal Transactions" %></p> |
||||
<% end %> |
||||
|
||||
<div class="address__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["address_id"]], |
||||
distance: 1, |
||||
filter: @conn.params["filter"], |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &address_internal_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %> |
||||
</div> |
||||
</div> |
||||
<div class="address__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["address_id"]], |
||||
distance: 1, |
||||
filter: @conn.params["filter"], |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &address_internal_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %> |
||||
</div> |
||||
</section> |
||||
</section> |
||||
|
@ -1,121 +1,127 @@ |
||||
<section class="container__section"> |
||||
<section class="container-fluid"> |
||||
|
||||
<%= render ExplorerWeb.AddressView, "overview.html", assigns %> |
||||
<div> |
||||
<ul class="nav nav-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link active", |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link", |
||||
"data-test": "internal_transactions_tab_link", |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="dropdown u-float-right u-push-sm"> |
||||
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" |
||||
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
Filter: <%= format_current_filter(@filter) %> |
||||
</button> |
||||
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2"> |
||||
<%= link( |
||||
gettext("All"), |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("To"), |
||||
to: address_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "to" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("From"), |
||||
to: address_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "from" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
|
||||
<section> |
||||
<div class="card"> |
||||
<div class="card-header"> |
||||
<ul class="nav nav-tabs card-header-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link active", |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link", |
||||
"data-test": "internal_transactions_tab_link", |
||||
to: address_internal_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
<div class="panels__container"> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<tr> |
||||
<th class="transactions__column-header transactions__column-header--status"> |
||||
<span class="transactions__column-title transactions__column-title--status"><%= gettext "Status" %></span> |
||||
</th> |
||||
<th><%= gettext "Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
||||
<th><%= gettext "Fee" %></th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @page.entries do %> |
||||
<div class="card-body"> |
||||
<div class="dropdown u-float-right u-push-sm"> |
||||
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" |
||||
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
Filter: <%= format_current_filter(@filter) %> |
||||
</button> |
||||
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2"> |
||||
<%= link( |
||||
gettext("All"), |
||||
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("To"), |
||||
to: address_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "to" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
<%= link( |
||||
gettext("From"), |
||||
to: address_transaction_path( |
||||
@conn, |
||||
:index, |
||||
@conn.assigns.locale, |
||||
@conn.params["address_id"], |
||||
filter: "from" |
||||
), |
||||
class: "address__link address__link--active dropdown-item", |
||||
"data-test": "filter_option" |
||||
) %> |
||||
</div> |
||||
</div> |
||||
|
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<tr> |
||||
<td><div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div></td> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link( |
||||
transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) |
||||
) %> |
||||
</td> |
||||
<td><%= transaction.block.timestamp |> Timex.from_now %></td> |
||||
<td class="address-cell"> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %></td> |
||||
<td><%= ExplorerWeb.TransactionView.formatted_fee(transaction, denomination: :ether) %></td> |
||||
<th class="transactions__column-header transactions__column-header--status"> |
||||
<span class="transactions__column-title transactions__column-title--status"><%= gettext "Status" %></span> |
||||
</th> |
||||
<th><%= gettext "Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
||||
<th><%= gettext "Fee" %></th> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @page.entries do %> |
||||
<tr> |
||||
<td><div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div></td> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link( |
||||
transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) |
||||
) %> |
||||
</td> |
||||
<td><%= transaction.block.timestamp |> Timex.from_now %></td> |
||||
<td class="address-cell"> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %></td> |
||||
<td><%= ExplorerWeb.TransactionView.formatted_fee(transaction, denomination: :ether) %></td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="address__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["address_id"]], |
||||
distance: 1, |
||||
filter: @conn.params["filter"], |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &address_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %> |
||||
</div> |
||||
</div> |
||||
<div class="address__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["address_id"]], |
||||
distance: 1, |
||||
filter: @conn.params["filter"], |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &address_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %> |
||||
</div> |
||||
</section> |
||||
</section> |
||||
|
@ -1,188 +1,195 @@ |
||||
<section class="container__section"> |
||||
<div> |
||||
<section class="container-fluid"> |
||||
<section> |
||||
<h1><%= gettext("Block Details") %></h1> |
||||
<h2 data-test="block_detail_number"><%= @block.number %></h2> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="panels__container row"> |
||||
<div class="col-lg-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Timestamp" %> |
||||
</th> |
||||
<td> |
||||
<%= age(@block) %> (<%= formatted_timestamp(@block) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Transaction" %> |
||||
</th> |
||||
<td> |
||||
<%= gettext "%{count} transactions in this block", count: @block_transaction_count %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Hash" %> |
||||
</th> |
||||
<td title="<%= @block.hash %>"> |
||||
<%= @block.hash %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Parent Hash" %> |
||||
</th> |
||||
<td title="<%= @block.parent_hash %>"> |
||||
<%= link( |
||||
@block.parent_hash, |
||||
class: "block__link", |
||||
to: block_path(@conn, :show, @conn.assigns.locale, @block.number - 1) |
||||
) %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Miner" %> |
||||
</th> |
||||
<td title="<%= @block.miner %>"> |
||||
<%= @block.miner %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Difficulty" %> |
||||
</th> |
||||
<td title="<%= @block.difficulty %>"> |
||||
<%= @block.difficulty |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<p data-test="block_detail_number"><%= @block.number %></p> |
||||
|
||||
<div class="card mb-3"> |
||||
<div class="card-body"> |
||||
<div class="row"> |
||||
<div class="col-lg-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Timestamp" %> |
||||
</th> |
||||
<td> |
||||
<%= age(@block) %> (<%= formatted_timestamp(@block) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Transaction" %> |
||||
</th> |
||||
<td> |
||||
<%= gettext "%{count} transactions in this block", count: @block_transaction_count %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Hash" %> |
||||
</th> |
||||
<td title="<%= @block.hash %>"> |
||||
<%= @block.hash %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Parent Hash" %> |
||||
</th> |
||||
<td title="<%= @block.parent_hash %>"> |
||||
<%= link( |
||||
@block.parent_hash, |
||||
class: "block__link", |
||||
to: block_path(@conn, :show, @conn.assigns.locale, @block.number - 1) |
||||
) %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Miner" %> |
||||
</th> |
||||
<td title="<%= @block.miner %>"> |
||||
<%= @block.miner %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Difficulty" %> |
||||
</th> |
||||
<td title="<%= @block.difficulty %>"> |
||||
<%= @block.difficulty |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div class="col-lg-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Total Difficulty" %> |
||||
</th> |
||||
<td title="<%= @block.total_difficulty %>"> |
||||
<%= @block.total_difficulty |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Size" %> |
||||
</th> |
||||
<td> |
||||
<%= Cldr.Unit.new(:byte, @block.size) |> Cldr.Unit.to_string! %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Used" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.gas_used |> Cldr.Number.to_string! %> (<%= (@block.gas_used / @block.gas_limit) |> Cldr.Number.to_string!(format: "#.#%") %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Limit" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.gas_limit |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="Nonce"> |
||||
<%= gettext "Nonce" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.nonce %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div class="col-lg-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Total Difficulty" %> |
||||
</th> |
||||
<td title="<%= @block.total_difficulty %>"> |
||||
<%= @block.total_difficulty |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Size" %> |
||||
</th> |
||||
<td> |
||||
<%= Cldr.Unit.new(:byte, @block.size) |> Cldr.Unit.to_string! %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Used" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.gas_used |> Cldr.Number.to_string! %> (<%= (@block.gas_used / @block.gas_limit) |> Cldr.Number.to_string!(format: "#.#%") %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Limit" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.gas_limit |> Cldr.Number.to_string! %> |
||||
</td> |
||||
</tr> |
||||
</div> |
||||
</section> |
||||
|
||||
<section> |
||||
<div class="card mb-3"> |
||||
<div class="card-header"> |
||||
<ul class="nav nav-tabs card-header-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link active", |
||||
to: block_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["block_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="card-body"> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<tr> |
||||
<th scope="Nonce"> |
||||
<%= gettext "Nonce" %> |
||||
<th> |
||||
<%= gettext "Status" %> |
||||
</th> |
||||
<td> |
||||
<%= @block.nonce %> |
||||
</td> |
||||
<th><%= gettext "Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %></th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @page.entries do %> |
||||
<tr> |
||||
<td> |
||||
<div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link( |
||||
transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) |
||||
) %> |
||||
</td> |
||||
<td> |
||||
<%= transaction.block.timestamp |> Timex.from_now %> |
||||
</td> |
||||
<td class="address-cell"> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td> |
||||
<%= ExplorerWeb.TransactionView.value(transaction) %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
<div> |
||||
<ul class="nav nav-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Transactions"), |
||||
class: "nav-link active", |
||||
to: block_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["block_id"]) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="panels__container"> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<tr> |
||||
<th> |
||||
<%= gettext "Status" %> |
||||
</th> |
||||
<th><%= gettext "Hash" %></th> |
||||
<th><%= gettext "Block" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %></th> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @page.entries do %> |
||||
<tr> |
||||
<td> |
||||
<div class="transaction__dot transaction__dot--<%= status(transaction) %>"></div> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= link( |
||||
transaction.block, |
||||
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) |
||||
) %> |
||||
</td> |
||||
<td> |
||||
<%= transaction.block.timestamp |> Timex.from_now %> |
||||
</td> |
||||
<td class="address-cell"> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td class="u-text-center"><i class="fas fa-arrow-circle-right"></i></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td> |
||||
<%= ExplorerWeb.TransactionView.value(transaction) %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
<div class="blocks__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["block_id"]], |
||||
distance: 1, |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &block_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %></div> |
||||
|
||||
<div class="blocks__pagination"> |
||||
<%= pagination_links( |
||||
@conn, |
||||
@page, |
||||
["en", @conn.params["block_id"]], |
||||
distance: 1, |
||||
first: true, |
||||
next: Phoenix.HTML.raw("›"), |
||||
path: &block_transaction_path/5, |
||||
previous: Phoenix.HTML.raw("‹"), |
||||
view_style: :bulma |
||||
) %></div> |
||||
</section> |
||||
</section> |
||||
|
@ -1,31 +1,31 @@ |
||||
<div class="panels container__subsection container__subsection-chain"> |
||||
<div class="panels__container panels__container--title"> |
||||
<div class="card"> |
||||
<div class="card-body"> |
||||
<%= link(gettext("View All"), to: block_path(@conn, :index, Gettext.get_locale), class: "button button--secondary button--xsmall u-float-right") %> |
||||
<h2 class="panels__title"><%= gettext "Blocks" %></h2> |
||||
<h2 class="card-title"><%= gettext "Blocks" %></h2> |
||||
<table class="table table-font table-responsive-lg"> |
||||
<thead> |
||||
<th><%= gettext "Height" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "TXNs" %></th> |
||||
<th><%= gettext "Gas" %></th> |
||||
<th><%= gettext "Validator" %></th> |
||||
</thead> |
||||
<tbody> |
||||
<%= for block <- @chain.blocks do %> |
||||
<tr data-test="chain_block"> |
||||
<td> |
||||
<img src="<%= static_path(@conn, "/images/block.svg") %>" /> |
||||
<%= link(block, to: block_path(@conn, :show, @conn.assigns.locale, block)) %> |
||||
</td> |
||||
<td><%= block.timestamp |> Timex.from_now %></td> |
||||
<td><%= block.transactions |> Enum.count %></td> |
||||
<td><%= block.gas_used |> Cldr.Number.to_string! %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: block.miner %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<table class="table table-font table-responsive-sm"> |
||||
<thead> |
||||
<th><%= gettext "Height" %></th> |
||||
<th><%= gettext "Age" %></th> |
||||
<th><%= gettext "TXNs" %></th> |
||||
<th><%= gettext "Gas" %></th> |
||||
<th><%= gettext "Validator" %></th> |
||||
</thead> |
||||
<tbody> |
||||
<%= for block <- @chain.blocks do %> |
||||
<tr data-test="chain_block"> |
||||
<td> |
||||
<img src="<%= static_path(@conn, "/images/block.svg") %>" /> |
||||
<%= link(block, to: block_path(@conn, :show, @conn.assigns.locale, block)) %> |
||||
</td> |
||||
<td><%= block.timestamp |> Timex.from_now %></td> |
||||
<td><%= block.transactions |> Enum.count %></td> |
||||
<td><%= block.gas_used |> Cldr.Number.to_string! %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: block.miner %> |
||||
</td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
|
@ -1,32 +1,32 @@ |
||||
<div class="panels container__subsection container__subsection-chain"> |
||||
<div class="panels__container panels__container--title"> |
||||
<div class="card"> |
||||
<div class="card-body"> |
||||
<%= link(gettext("View All"), to: transaction_path(@conn, :index, Gettext.get_locale), class: "button button--secondary button--xsmall u-float-right") %> |
||||
<h2 class="panels__title"><%= gettext "Transactions" %></h2> |
||||
<h2 class="card-title"><%= gettext "Transactions" %></h2> |
||||
<table class="table table-font table-responsive-lg"> |
||||
<thead> |
||||
<th><%= gettext "TX Hash" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
||||
<th><%= gettext "Age" %></th> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @chain.transactions do %> |
||||
<tr data-test="chain_transaction"> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> </td> |
||||
<td><%= transaction.block.timestamp |> Timex.from_now() %></td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<table class="table table-font table-responsive-sm"> |
||||
<thead> |
||||
<th><%= gettext "TX Hash" %></th> |
||||
<th><%= gettext "From" %></th> |
||||
<th><%= gettext "To" %></th> |
||||
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> |
||||
<th><%= gettext "Age" %></th> |
||||
</thead> |
||||
<tbody> |
||||
<%= for transaction <- @chain.transactions do %> |
||||
<tr data-test="chain_transaction"> |
||||
<td> |
||||
<%= render ExplorerWeb.TransactionView, "_link.html", conn: @conn, transaction: transaction %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> </td> |
||||
<td><%= transaction.block.timestamp |> Timex.from_now() %></td> |
||||
</tr> |
||||
<% end %> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
|
@ -1,49 +1,59 @@ |
||||
<section> |
||||
<section class="container__section container__section--partitioned"> |
||||
<div class="container__stats"> |
||||
<div> |
||||
<%= render ExplorerWeb.IconsView, "_block_icon.html", assigns %> |
||||
<div><%= gettext("Block") %></div> |
||||
<div> #<%= @chain.number %></div> |
||||
</div> |
||||
<div> |
||||
<%= render ExplorerWeb.IconsView, "_hourglass_icon.html", assigns %> |
||||
<div> <%= gettext("Last Block") %></div> |
||||
<div> <%= @chain.timestamp |> Timex.from_now() %></div> |
||||
</div> |
||||
<div> |
||||
<div class="stroke"> <%= render ExplorerWeb.IconsView, "_guage_icon.html", assigns %> </div> |
||||
<div><%= gettext("Avg Block Time") %></div> |
||||
<%= @chain.average_time |> Timex.format_duration(:humanized) %> |
||||
</div> |
||||
<div> |
||||
<%= render ExplorerWeb.IconsView, "_transaction_icon.html", assigns %> |
||||
<div> <%= gettext("TPM") %></div> |
||||
<div> <%= @chain.transaction_velocity |> Cldr.Number.to_string! %></div> |
||||
</div> |
||||
</div> |
||||
<div class="chain container__subsection container__subsection-chain"> |
||||
<canvas data-chart="marketHistoryChart" data-current_exchange_rate ='<%= @exchange_rate.usd_value %>' data-available_supply='<%= @exchange_rate.available_supply %>' data-market_history_data='<%=raw encode_market_history_data(@market_history_data) %>' width="300" height="100"></canvas> |
||||
<div class="graph-flex"> |
||||
<div class="u-push-md-left"> |
||||
<div class="graph__squares graph__squares--price"></div> |
||||
<%= gettext "Price" %> </br> |
||||
<%= format_exchange_rate(@exchange_rate) %> |
||||
<section class="container-fluid"> |
||||
<div class="d-flex flex-md-row flex-column"> |
||||
<div class="container__stats card mr-sm-4 mb-4 mb-sm-0"> |
||||
<div class="card-body d-flex flex-md-column justify-content-around"> |
||||
<div class="d-flex flex-column justify-content-center align-items-center"> |
||||
<%= render ExplorerWeb.IconsView, "_block_icon.html", assigns %> |
||||
<div><%= gettext("Block") %></div> |
||||
<div> #<%= @chain.number %></div> |
||||
</div> |
||||
<div class="d-flex flex-column justify-content-center align-items-center"> |
||||
<%= render ExplorerWeb.IconsView, "_hourglass_icon.html", assigns %> |
||||
<div> <%= gettext("Last Block") %></div> |
||||
<div> <%= @chain.timestamp |> Timex.from_now() %></div> |
||||
</div> |
||||
<div> |
||||
<div class="graph__squares graph__squares--mcap"></div> |
||||
<%= gettext "Market Cap" %> </br> |
||||
<%= format_market_cap(@exchange_rate) %> |
||||
<div class="d-flex flex-column justify-content-center align-items-center"> |
||||
<div class="stroke"> <%= render ExplorerWeb.IconsView, "_guage_icon.html", assigns %> </div> |
||||
<div><%= gettext("Avg Block Time") %></div> |
||||
<%= @chain.average_time |> Timex.format_duration(:humanized) %> |
||||
</div> |
||||
<div class="u-push-md-right"> |
||||
<%= gettext "24h Volume" %> </br> |
||||
<%= format_volume_24h(@exchange_rate) %> |
||||
<div class="d-flex flex-column justify-content-center align-items-center"> |
||||
<%= render ExplorerWeb.IconsView, "_transaction_icon.html", assigns %> |
||||
<div> <%= gettext("TPM") %></div> |
||||
<div> <%= @chain.transaction_velocity |> Cldr.Number.to_string! %></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
</section> |
||||
<section class="container__section container__section--partitioned"> |
||||
<%= render ExplorerWeb.ChainView, "_blocks.html", assigns %> |
||||
<%= render ExplorerWeb.ChainView, "_transactions.html", assigns %> |
||||
|
||||
<div class="container__graph card"> |
||||
<div class="card-body"> |
||||
<canvas data-chart="marketHistoryChart" data-current_exchange_rate ='<%= @exchange_rate.usd_value %>' data-available_supply='<%= @exchange_rate.available_supply %>' data-market_history_data='<%=raw encode_market_history_data(@market_history_data) %>' width="300" height="100"></canvas> |
||||
<div class="d-flex justify-content-sm-around mt-2 text-muted"> |
||||
<div> |
||||
<div class="graph__squares graph__squares--price"></div> |
||||
<%= gettext "Price" %> </br> |
||||
$<%= format_exchange_rate(@exchange_rate) %> <%= gettext "USD" %> |
||||
</div> |
||||
<div class="mx-2"> |
||||
<div class="graph__squares graph__squares--mcap"></div> |
||||
<%= gettext "Market Cap" %> </br> |
||||
$<%= format_market_cap(@exchange_rate) %> <%= gettext "USD" %> |
||||
</div> |
||||
<div> |
||||
<%= gettext "24h Volume" %> </br> |
||||
$<%= format_volume_24h(@exchange_rate) %> <%= gettext "USD" %> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="row my-4"> |
||||
<div class="col-md-6 mb-4 mb-md-0"> |
||||
<%= render ExplorerWeb.ChainView, "_blocks.html", assigns %> |
||||
</div> |
||||
<div class="col-md-6"> |
||||
<%= render ExplorerWeb.ChainView, "_transactions.html", assigns %> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
@ -1,37 +1,36 @@ |
||||
<header class="header"> |
||||
<div class="header__row header__row--search"> |
||||
<div class="header__cell header__cell--search"> |
||||
<%= form_for @conn, chain_path(@conn, :search, Gettext.get_locale), [class: "header__cell--search-form", method: :get, enforce_utf8: false], fn f -> %> |
||||
<i class="header__cell--search-glass fa fa-search"></i> |
||||
<%= search_input f, :q, class: 'header__cell--search-input', placeholder: gettext("Search by address, transaction hash, or block number"), "data-test": "search_input" %> |
||||
<% end %> |
||||
</div> |
||||
<div class="header__row header__row--search"> |
||||
<div class="header__cell header__cell--search"> |
||||
<%= form_for @conn, chain_path(@conn, :search, Gettext.get_locale), [class: "header__cell--search-form", method: :get, enforce_utf8: false], fn f -> %> |
||||
<i class="header__cell--search-glass fa fa-search"></i> |
||||
<%= search_input f, :q, class: 'header__cell--search-input', placeholder: gettext("Search by address, transaction hash, or block number"), "data-test": "search_input" %> |
||||
<% end %> |
||||
</div> |
||||
<div class="header__row header__row--topnav"> |
||||
<div class="header__cell header__cell--links" align="right"> |
||||
<%= link to: chain_path(@conn, :show) do %> |
||||
<div tabindex="0"> |
||||
<i class="fas fa-home fa-2x"></i> |
||||
</div> |
||||
</div> |
||||
|
||||
<nav class="header__row header__row--topnav"> |
||||
<ul class="nav"> |
||||
<li class="nav-item"> |
||||
<%= link to: chain_path(@conn, :show), class: "nav-link" do %> |
||||
<i class="fas fa-home fa-2x text-muted"></i> |
||||
<% end %> |
||||
</div> |
||||
<div class="header__cell header__cell--links" align="right"> |
||||
<%= link to: block_path(@conn, :index, Gettext.get_locale) do %> |
||||
<div tabindex="0"> |
||||
<img src="<%= static_path(@conn, "/images/block.svg") %>" /> |
||||
<%= gettext("Blocks") %> |
||||
</div> |
||||
</li> |
||||
<li calss="nav-item"> |
||||
<%= link to: block_path(@conn, :index, Gettext.get_locale), class: "nav-link" do %> |
||||
<img src="<%= static_path(@conn, "/images/block.svg") %>" /> |
||||
<%= gettext("Blocks") %> |
||||
<% end %> |
||||
</div> |
||||
<div class="header__cell header__cell--links dropdown"> |
||||
<a class="dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
</li> |
||||
<li calss="nav-item dropdown"> |
||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> |
||||
<img src="<%= static_path(@conn, "/images/transaction.svg") %>" /> |
||||
<%= gettext("Transactions") %> |
||||
</a> |
||||
<div class="dropdown-menu topnav-dropdown" aria-labelledby="navbarDropdown"> |
||||
<%= link(gettext("Validated"), to: transaction_path(@conn, :index, Gettext.get_locale), class: "dropdown-item topnav-dropdown-items") %> |
||||
<%= link(gettext("Pending"), to: pending_transaction_path(@conn, :index, Gettext.get_locale), class: "dropdown-item topnav-dropdown-items") %> |
||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown"> |
||||
<%= link(gettext("Validated"), to: transaction_path(@conn, :index, Gettext.get_locale), class: "dropdown-item") %> |
||||
<%= link(gettext("Pending"), to: pending_transaction_path(@conn, :index, Gettext.get_locale), class: "dropdown-item") %> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</li> |
||||
</ul> |
||||
</nav> |
||||
</header> |
||||
|
@ -1,160 +1,165 @@ |
||||
<h1><%= gettext "Transaction Details" %></h1> |
||||
<p data-test="transaction_detail_hash"><%= @transaction %></p> |
||||
<div class="panels container__subsection"> |
||||
<div class="panels__container row"> |
||||
<div class="col-md-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Transaction Status" %> |
||||
</th> |
||||
<td> |
||||
<%= formatted_status(@transaction) %> |
||||
<div class="transaction__dot transaction__dot--<%= status(@transaction) %>"></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Block Number" %> |
||||
</th> |
||||
<td> |
||||
<% block = @transaction.block %> |
||||
<%= if block do %> |
||||
<%= link( |
||||
block, |
||||
class: "transaction__link", |
||||
to: block_path(@conn, :show, @conn.assigns.locale, block) |
||||
) %> |
||||
<% end %> |
||||
(<%= gettext "%{confirmations} block confirmations", confirmations: confirmations(@transaction, max_block_number: @max_block_number) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Age" %> |
||||
</th> |
||||
<td title="<%= formatted_timestamp(@transaction) %>"> |
||||
<%= formatted_age(@transaction) %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Value" %> |
||||
</th> |
||||
<td> |
||||
<div><%= value(@transaction) %> </div> |
||||
<div><%= formatted_usd_value(@transaction, @exchange_rate) %></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "From" %> |
||||
</th> |
||||
<td> |
||||
<%= if @transaction.from_address do %> |
||||
<%= link( |
||||
@transaction.from_address, |
||||
class: "transaction__link", |
||||
to: address_path(@conn, :show, @conn.assigns.locale, @transaction.from_address) |
||||
) %> |
||||
<% else %> |
||||
<%= gettext "Pending" %> |
||||
<% end %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "To" %> |
||||
</th> |
||||
<td> |
||||
<%= if @transaction.to_address do %> |
||||
<%= link( |
||||
@transaction.to_address, |
||||
class: "transaction__link", |
||||
to: address_path(@conn, :show, @conn.assigns.locale, @transaction.to_address) |
||||
) %> |
||||
<% else %> |
||||
<%= gettext "Pending" %> |
||||
<% end %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Nonce" %> |
||||
</th> |
||||
<td> |
||||
<%= @transaction.nonce %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div class="col-md-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "First Seen" %> |
||||
</th> |
||||
<% first_seen = first_seen(@transaction) %> |
||||
<td title="<%= first_seen %>"> |
||||
<%= first_seen %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Last Seen" %> |
||||
</th> |
||||
<% last_seen = last_seen(@transaction) %> |
||||
<td title="<%= last_seen %>"> |
||||
<%= last_seen %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Limit" %> |
||||
</th> |
||||
<td title="<%= last_seen %>"> |
||||
<%= format_gas_limit(@transaction.gas) %> <%= gettext("Gas") %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Price" %> |
||||
</th> |
||||
<td title="<%= last_seen %>"> |
||||
<%= gas_price(@transaction, :ether) %> |
||||
(<%= gas_price(@transaction, :gwei) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "TX Fee" %> |
||||
</th> |
||||
<td> |
||||
<div><%= formatted_fee(@transaction, denomination: :ether) %></div> |
||||
<div><%= formatted_fee(@transaction, exchange_rate: @exchange_rate) %></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Total Gas Used" %> |
||||
</th> |
||||
<td title="<%= last_seen %>"> |
||||
<%= cumulative_gas_used(@transaction) %> <%= gettext("Wei") %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Input" %> |
||||
</th> |
||||
<td title="<%= @transaction.input %>"> |
||||
<%= @transaction.input %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
<section> |
||||
<h1><%= gettext "Transaction Details" %></h1> |
||||
<p data-test="transaction_detail_hash"><%= @transaction %></p> |
||||
|
||||
<div class="card mb-3"> |
||||
<div class="card-body"> |
||||
<div class="row"> |
||||
<div class="col-md-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Transaction Status" %> |
||||
</th> |
||||
<td> |
||||
<%= formatted_status(@transaction) %> |
||||
<div class="transaction__dot transaction__dot--<%= status(@transaction) %>"></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Block Number" %> |
||||
</th> |
||||
<td> |
||||
<% block = @transaction.block %> |
||||
<%= if block do %> |
||||
<%= link( |
||||
block, |
||||
class: "transaction__link", |
||||
to: block_path(@conn, :show, @conn.assigns.locale, block) |
||||
) %> |
||||
<% end %> |
||||
(<%= gettext "%{confirmations} block confirmations", confirmations: confirmations(@transaction, max_block_number: @max_block_number) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Age" %> |
||||
</th> |
||||
<td title="<%= formatted_timestamp(@transaction) %>"> |
||||
<%= formatted_age(@transaction) %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Value" %> |
||||
</th> |
||||
<td> |
||||
<div><%= value(@transaction) %> </div> |
||||
<div><%= formatted_usd_value(@transaction, @exchange_rate) %></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "From" %> |
||||
</th> |
||||
<td> |
||||
<%= if @transaction.from_address do %> |
||||
<%= link( |
||||
@transaction.from_address, |
||||
class: "transaction__link", |
||||
to: address_path(@conn, :show, @conn.assigns.locale, @transaction.from_address) |
||||
) %> |
||||
<% else %> |
||||
<%= gettext "Pending" %> |
||||
<% end %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "To" %> |
||||
</th> |
||||
<td> |
||||
<%= if @transaction.to_address do %> |
||||
<%= link( |
||||
@transaction.to_address, |
||||
class: "transaction__link", |
||||
to: address_path(@conn, :show, @conn.assigns.locale, @transaction.to_address) |
||||
) %> |
||||
<% else %> |
||||
<%= gettext "Pending" %> |
||||
<% end %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Nonce" %> |
||||
</th> |
||||
<td> |
||||
<%= @transaction.nonce %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
<div class="col-md-6"> |
||||
<table class="table table-font table-responsive-sm table-horizontal"> |
||||
<tbody> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "First Seen" %> |
||||
</th> |
||||
<% first_seen = first_seen(@transaction) %> |
||||
<td title="<%= first_seen %>"> |
||||
<%= first_seen %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Last Seen" %> |
||||
</th> |
||||
<% last_seen = last_seen(@transaction) %> |
||||
<td title="<%= last_seen %>"> |
||||
<%= last_seen %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Limit" %> |
||||
</th> |
||||
<td title="<%= format_gas_limit(@transaction.gas) %>"> |
||||
<%= format_gas_limit(@transaction.gas) %> <%= gettext("Gas") %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Gas Price" %> |
||||
</th> |
||||
<td title="<%= gas_price(@transaction, :wei) %>"> |
||||
<%= gas_price(@transaction, :wei) %> |
||||
(<%= gas_price(@transaction, :gwei) %>) |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "TX Fee" %> |
||||
</th> |
||||
<td> |
||||
<div><%= formatted_fee(@transaction, denomination: :ether) %></div> |
||||
<div><%= formatted_fee(@transaction, exchange_rate: @exchange_rate) %></div> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Total Gas Used" %> |
||||
</th> |
||||
<td title="<%= cumulative_gas_used(@transaction) %>"> |
||||
<%= cumulative_gas_used(@transaction) %> <%= gettext("Wei") %> |
||||
</td> |
||||
</tr> |
||||
<tr> |
||||
<th scope="row"> |
||||
<%= gettext "Input" %> |
||||
</th> |
||||
<td title="<%= @transaction.input %>"> |
||||
<%= @transaction.input %> |
||||
</td> |
||||
</tr> |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
|
@ -1,54 +1,58 @@ |
||||
<section class="container__section"> |
||||
<section class="container-fluid"> |
||||
|
||||
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> |
||||
<div> |
||||
<ul class="nav nav-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="panels container__subsection"> |
||||
<div class="panels__container"> |
||||
<%= if length(@internal_transactions.entries) > 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 Limit" %> (<%= gettext "Gas" %>)</th> |
||||
</thead> |
||||
<%= for transaction <- @internal_transactions do %> |
||||
<tgroup> |
||||
<tr> |
||||
<td><%= transaction.call_type %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= value(transaction, include_label: false) %></td> |
||||
<td><%= gas(transaction) %></td> |
||||
</tr> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no Internal Transactions" %></p> |
||||
<% end %> |
||||
|
||||
<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 length(@internal_transactions.entries) > 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 Limit" %> (<%= gettext "Gas" %>)</th> |
||||
</thead> |
||||
<%= for transaction <- @internal_transactions do %> |
||||
<tgroup> |
||||
<tr> |
||||
<td><%= transaction.call_type %></td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> |
||||
</td> |
||||
<td> |
||||
<%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> |
||||
</td> |
||||
<td><%= value(transaction, include_label: false) %></td> |
||||
<td><%= gas(transaction) %></td> |
||||
</tr> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no Internal Transactions" %></p> |
||||
<% end %> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
</section> |
||||
|
@ -1,68 +1,72 @@ |
||||
<section class="container__section"> |
||||
<section class="container-fluid"> |
||||
|
||||
<%= render ExplorerWeb.TransactionView, "overview.html", assigns %> |
||||
<div> |
||||
<ul class="nav nav-tabs"> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Internal Transactions"), |
||||
class: "nav-link", |
||||
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Logs"), |
||||
class: "nav-link active", |
||||
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="panels container__subsection"> |
||||
<div class="panels__container"> |
||||
<%= if length(@logs.entries) > 0 do %> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<th><%= gettext "Address" %></th> |
||||
<th><%= gettext "Topic" %></th> |
||||
</thead> |
||||
<%= for log <- @logs.entries do %> |
||||
<tgroup> |
||||
<tr data-test="transaction_log"> |
||||
<td> |
||||
<%= link( |
||||
log.address, |
||||
to: address_path(@conn, :show, @conn.assigns.locale, log.address), |
||||
"data-test": "log_address_link", |
||||
"data-address-hash": log.address |
||||
) %> |
||||
</td> |
||||
<td><%= log.first_topic %></td> |
||||
</tr> |
||||
<% unless is_nil(log.second_topic) do %> |
||||
<tr> |
||||
<td>topic[1]</td> |
||||
<td><%= log.second_topic %></td> |
||||
|
||||
<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", |
||||
to: transaction_path(@conn, :show, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
<li class="nav-item"> |
||||
<%= link( |
||||
gettext("Logs"), |
||||
class: "nav-link active", |
||||
to: transaction_log_path(@conn, :index, @conn.assigns.locale, @transaction) |
||||
) %> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
<div class="card-body"> |
||||
<%= if length(@logs.entries) > 0 do %> |
||||
<table class="table table-responsive-sm table-font"> |
||||
<thead> |
||||
<th><%= gettext "Address" %></th> |
||||
<th><%= gettext "Topic" %></th> |
||||
</thead> |
||||
<%= for log <- @logs.entries do %> |
||||
<tgroup> |
||||
<tr data-test="transaction_log"> |
||||
<td> |
||||
<%= link( |
||||
log.address, |
||||
to: address_path(@conn, :show, @conn.assigns.locale, log.address), |
||||
"data-test": "log_address_link", |
||||
"data-address-hash": log.address |
||||
) %> |
||||
</td> |
||||
<td><%= log.first_topic %></td> |
||||
</tr> |
||||
<% end %> |
||||
<% unless is_nil(log.third_topic) do %> |
||||
<tr> |
||||
<td>topic[2]</td> |
||||
<td><%= log.third_topic %></td> |
||||
</tr> |
||||
<% end %> |
||||
<% unless is_nil(log.data) do %> |
||||
<tr> |
||||
<td>↠</td> |
||||
<td><%= log.data %></td> |
||||
</tr> |
||||
<% end %> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no logs currently." %></p> |
||||
<% end %> |
||||
<% unless is_nil(log.second_topic) do %> |
||||
<tr> |
||||
<td>topic[1]</td> |
||||
<td><%= log.second_topic %></td> |
||||
</tr> |
||||
<% end %> |
||||
<% unless is_nil(log.third_topic) do %> |
||||
<tr> |
||||
<td>topic[2]</td> |
||||
<td><%= log.third_topic %></td> |
||||
</tr> |
||||
<% end %> |
||||
<% unless is_nil(log.data) do %> |
||||
<tr> |
||||
<td>↠</td> |
||||
<td><%= log.data %></td> |
||||
</tr> |
||||
<% end %> |
||||
</tgroup> |
||||
<% end %> |
||||
</table> |
||||
<% else %> |
||||
<p><%= gettext "There are no logs currently." %></p> |
||||
<% end %> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
</section> |
||||
</section> |
||||
|
Loading…
Reference in new issue