Tweaked the transaction panels for address and homepage/view all

pull/412/head
katibest 6 years ago
parent 39b83dd187
commit 9432dee47b
  1. 1
      apps/explorer_web/assets/css/components/_tile.scss
  2. 2
      apps/explorer_web/assets/css/theme/_poa_variables.scss
  3. 28
      apps/explorer_web/lib/explorer_web/templates/address_transaction/_transaction.html.eex
  4. 15
      apps/explorer_web/lib/explorer_web/templates/chain/_transactions.html.eex
  5. 13
      apps/explorer_web/lib/explorer_web/templates/transaction/index.html.eex

@ -70,7 +70,6 @@
font-weight: 600; font-weight: 600;
color: $gray-700; color: $gray-700;
margin-bottom: 0; margin-bottom: 0;
display: block;
} }
} }

@ -38,7 +38,7 @@ $blue: #4786ff !default;
$indigo: #5b33a1 !default; $indigo: #5b33a1 !default;
$purple: #9987fc !default; $purple: #9987fc !default;
$pink: #e83e8c !default; $pink: #e83e8c !default;
$red: #dc3545 !default; $red: #c74d39 !default;
$orange: #ef9a60 !default; $orange: #ef9a60 !default;
$yellow: #ffc107 !default; $yellow: #ffc107 !default;
$green: #20b760 !default; $green: #20b760 !default;

@ -1,12 +1,8 @@
<div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in" data-transaction-hash="<%= @transaction.hash %>"> <div class="tile tile-type-<%= ExplorerWeb.TransactionView.type_suffix(@transaction) %> fade-in" data-transaction-hash="<%= @transaction.hash %>">
<div class="row"> <div class="row">
<div class="col-md-2 d-flex align-items-center justify-content-start justify-content-lg-center tile-label"> <div class="pl-5 col-md-2 d-flex flex-column align-items-left justify-content-start justify-content-lg-center tile-label">
<div class="col-md-1" data-test="transaction_status">
<div class="transaction__dot transaction__dot--<%= status(@transaction) %>" data-toggle="tooltip" title="<%= formatted_status(@transaction) %>"></div>
</div>
<div class="col-md-11">
<%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %> <%= ExplorerWeb.TransactionView.transaction_display_type(@transaction) %>
</div> <div data-test="transaction_status" class="text-muted"><%= formatted_status(@transaction) %></div>
</div> </div>
<div class="col-md-7 col-lg-8 d-flex flex-column"> <div class="col-md-7 col-lg-8 d-flex flex-column">
<%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %> <%= render ExplorerWeb.TransactionView, "_link.html", locale: @locale, transaction_hash: @transaction.hash %>
@ -16,6 +12,7 @@
<% else %> <% else %>
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: @transaction.from_address_hash, contract: ExplorerWeb.AddressView.contract?(@transaction.from_address), locale: @locale %>
<% end %> <% end %>
&rarr; &rarr;
<%= if @address.hash == ExplorerWeb.TransactionView.to_address_hash(@transaction) do %> <%= if @address.hash == ExplorerWeb.TransactionView.to_address_hash(@transaction) do %>
<%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address) %> <%= render ExplorerWeb.AddressView, "_responsive_hash.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address) %>
@ -23,19 +20,26 @@
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(@transaction), contract: ExplorerWeb.AddressView.contract?(@transaction.to_address), locale: @locale %>
<% end %> <% end %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> POA <span>
</div>
<div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start justify-content-md-end align-items-end text-md-right">
<%= if @address.hash == @transaction.from_address_hash do %> <%= if @address.hash == @transaction.from_address_hash do %>
<span class="badge badge-warning tile-badge mr-2 mr-md-0">OUT</span> <span class="badge badge-danger tile-badge">Out</span>
<% else %> <% else %>
<span class="badge badge-success tile-badge mr-2 mr-md-0">IN</span> <span class="badge badge-success tile-badge">In</span>
<% end %> <% end %>
<span class="mr-2 mr-sm-0" data-from-now="<%= @transaction.block.timestamp %>"></span> <span class="ml-1" data-from-now="<%= @transaction.block.timestamp %>"></span>
<span class="ml-1">
<%= link( <%= link(
gettext("Block #") <> "#{@transaction.block.number}", gettext("Block #") <> "#{@transaction.block.number}",
to: block_path(ExplorerWeb.Endpoint, :show, @locale, @transaction.block) to: block_path(ExplorerWeb.Endpoint, :show, @locale, @transaction.block)
) %> ) %>
</span>
</span>
</div>
<div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start align-items-end text-md-right">
<span class="tile-title">
<%= ExplorerWeb.TransactionView.value(@transaction, include_label: false) %> POA
</span>
<span class="mr-2 mr-sm-0 text-muted"> <%= ExplorerWeb.TransactionView.formatted_fee(@transaction, denomination: :ether) %> <%= gettext "Fee" %></span>
</div> </div>
</div> </div>
</div> </div>

@ -18,14 +18,21 @@
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA <span>
</div> <span class="ml-1" data-from-now="<%= transaction.block.timestamp %>"></span>
<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"> <span class="ml-1">
<span class="mr-2 mr-sm-0" data-from-now="<%= transaction.block.timestamp %>"></span>
<%= link( <%= link(
gettext("Block #") <> "#{transaction.block.number}", gettext("Block #") <> "#{transaction.block.number}",
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) to: block_path(@conn, :show, @conn.assigns.locale, transaction.block)
) %> ) %>
</span>
</span>
</div>
<div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start text-md-right">
<span class="tile-title">
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA
</span>
<span><%= ExplorerWeb.TransactionView.formatted_fee(transaction, denomination: :ether) %> <%= gettext "Fee" %></span>
</div> </div>
</div> </div>
</div> </div>

@ -40,14 +40,19 @@
&rarr; &rarr;
<%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %> <%= render ExplorerWeb.AddressView, "_link.html", address_hash: ExplorerWeb.TransactionView.to_address_hash(transaction), contract: ExplorerWeb.AddressView.contract?(transaction.to_address), locale: @locale %>
</span> </span>
<%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA <span>
</div> <span data-from-now="<%= transaction.block.timestamp %>"></span>
<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"> <span class="ml-1">
<span class="mr-2 mr-sm-0" data-from-now="<%= transaction.block.timestamp %>"></span>
<%= link( <%= link(
gettext("Block #") <> "#{transaction.block.number}", gettext("Block #") <> "#{transaction.block.number}",
to: block_path(@conn, :show, @conn.assigns.locale, transaction.block) to: block_path(@conn, :show, @conn.assigns.locale, transaction.block)
) %> ) %>
</span>
</span>
</div>
<div class="col-md-3 col-lg-2 d-flex flex-row flex-md-column justify-content-start text-md-right">
<span class="tile-title"><%= ExplorerWeb.TransactionView.value(transaction, include_label: false) %> POA</span>
<span> <%= ExplorerWeb.TransactionView.formatted_fee(transaction, denomination: :ether) %> <%= gettext "Fee" %></span>
</div> </div>
</div> </div>
</div> </div>

Loading…
Cancel
Save