Added tabs and new style to pending transactions

pull/395/head
katibest 6 years ago committed by jimmay5469
parent 523e6cd817
commit 9f4fd398c2
  1. 102
      apps/explorer_web/lib/explorer_web/templates/pending_transaction/index.html.eex
  2. 22
      apps/explorer_web/lib/explorer_web/templates/transaction/index.html.eex

@ -1,14 +1,7 @@
<section class="container-fluid"> <section class="container">
<h1>
Transactions
</h1>
<p>
<%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %>
</p>
<div class="card"> <div class="card">
<div class="card-header"> <div class="card-header">
<ul class="nav nav-tabs card-header-tabs"> <ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex">
<li class="nav-item"> <li class="nav-item">
<%= link( <%= link(
gettext("Validated"), gettext("Validated"),
@ -20,64 +13,51 @@
<%= link( <%= link(
gettext("Pending"), gettext("Pending"),
class: "nav-link active", class: "nav-link active",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index, @conn.assigns.locale) to: pending_transaction_path(@conn, :index, @conn.assigns.locale)
) %> ) %>
</li> </li>
</ul> </ul>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table table-responsive-sm table-font"> <h2 class="card-title mb-0"><%= gettext "Transactions" %></h2>
<thead> <p><%= gettext("Showing %{count} Pending Transactions", count: @pending_transaction_count) %></p>
<tr>
<th> <%= for transaction <- @transactions do %>
<%= gettext "Status" %> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-test="<%= ExplorerWeb.TransactionView.type_suffix(transaction) %>" data-transaction-hash="<%= transaction.hash %>">
</th> <div class="row" data-test="chain_transaction">
<th><%= gettext "Hash" %></th> <div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label">
<th><%= gettext "Last Seen" %></th> <%= ExplorerWeb.TransactionView.transaction_display_type(transaction) %>
<th><%= gettext "From" %></th> </div>
<th><%= gettext "To" %></th> <div class="col-md-7 col-lg-8 d-flex flex-column">
<th><%= gettext "Value" %> (<%= gettext "Ether" %>)</th> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %>
</tr> <span>
</thead> <%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %>
<tbody> &rarr;
<%= for transaction <- @transactions do %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address) %>
<tr data-transaction-hash="<%= transaction.hash %>"> </span>
<td> <%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA
<div class="transaction__dot transaction__dot--pending"></div> </div>
</td> <div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start justify-content-md-end text-md-right">
<td>
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: transaction.hash %> </div>
</td> </div>
<td data-from-now="<%= transaction.updated_at %>"></td> </div>
<td> <% end %>
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.from_address), address_hash: transaction.from_address_hash %> <%= if @next_page_params do %>
</td> <%= link(
<td> gettext("Older"),
<%= if transaction.to_address_hash != nil do %> class: "button button--secondary button--sm float-right mt-3",
<%= render ExplorerWeb.AddressView, "_link.html", locale: @locale, contract: ExplorerWeb.AddressView.contract?(transaction.to_address), address_hash: transaction.to_address_hash %> to: pending_transaction_path(
<% else %> @conn,
<%= gettext "Contract Creation" %> :index,
<% end %> @conn.assigns.locale,
</td> @next_page_params
<td> )
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> ) %>
</td> <% end %>
</tr>
<% end %>
</tbody>
</table>
</div> </div>
</div> </div>
<%= if @next_page_params do %>
<%= link(
gettext("Older"),
class: "button button--secondary button--sm float-right mt-3",
to: pending_transaction_path(
@conn,
:index,
@conn.assigns.locale,
@next_page_params
)
) %>
<% end %>
</section> </section>

@ -1,5 +1,25 @@
<section class="container-fluid"> <section class="container">
<div class="card"> <div class="card">
<div class="card-header">
<ul class="nav nav-tabs card-header-tabs d-none d-md-inline-flex">
<li class="nav-item">
<%= link(
gettext("Validated"),
class: "nav-link active",
to: transaction_path(@conn, :index, @conn.assigns.locale)
) %>
</li>
<li class="nav-item">
<%= link(
gettext("Pending"),
class: "nav-link",
"data-test": "pending_transactions_link",
to: pending_transaction_path(@conn, :index, @conn.assigns.locale)
) %>
</li>
</ul>
</div>
<div class="card-body"> <div class="card-body">
<h2 class="card-title mb-0"><%= gettext "Transactions" %></h2> <h2 class="card-title mb-0"><%= gettext "Transactions" %></h2>
<p><%= gettext("Showing %{count} Validated Transactions", count: Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###")) %></p> <p><%= gettext("Showing %{count} Validated Transactions", count: Cldr.Number.to_string!(@transaction_estimated_count, format: "#,###")) %></p>

Loading…
Cancel
Save