From e8657dfdea51baf4adb2ba44b5d67bb5e169cadd Mon Sep 17 00:00:00 2001 From: Ryan Arthur Date: Wed, 23 May 2018 15:26:43 -0400 Subject: [PATCH] Apply Bootstrap cards to the Transaction Details pages --- .../templates/transaction/overview.html.eex | 321 +++++++++--------- .../index.html.eex | 70 ++-- .../templates/transaction_log/index.html.eex | 98 +++--- 3 files changed, 249 insertions(+), 240 deletions(-) diff --git a/apps/explorer_web/lib/explorer_web/templates/transaction/overview.html.eex b/apps/explorer_web/lib/explorer_web/templates/transaction/overview.html.eex index f43d2068f9..9a5c9299ae 100644 --- a/apps/explorer_web/lib/explorer_web/templates/transaction/overview.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/transaction/overview.html.eex @@ -1,160 +1,165 @@ -

<%= gettext "Transaction Details" %>

-

<%= @transaction %>

-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- <%= gettext "Transaction Status" %> - - <%= formatted_status(@transaction) %> -
-
- <%= gettext "Block Number" %> - - <% 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) %>) -
- <%= gettext "Age" %> - - <%= formatted_age(@transaction) %> -
- <%= gettext "Value" %> - -
<%= value(@transaction) %>
-
<%= formatted_usd_value(@transaction, @exchange_rate) %>
-
- <%= gettext "From" %> - - <%= 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 %> -
- <%= gettext "To" %> - - <%= 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 %> -
- <%= gettext "Nonce" %> - - <%= @transaction.nonce %> -
-
-
- - - - - <% first_seen = first_seen(@transaction) %> - - - - - <% last_seen = last_seen(@transaction) %> - - - - - - - - - - - - - - - - - - - - - - - -
- <%= gettext "First Seen" %> - - <%= first_seen %> -
- <%= gettext "Last Seen" %> - - <%= last_seen %> -
- <%= gettext "Gas Limit" %> - - <%= format_gas_limit(@transaction.gas) %> <%= gettext("Gas") %> -
- <%= gettext "Gas Price" %> - - <%= gas_price(@transaction, :wei) %> - (<%= gas_price(@transaction, :gwei) %>) -
- <%= gettext "TX Fee" %> - -
<%= formatted_fee(@transaction, denomination: :ether) %>
-
<%= formatted_fee(@transaction, exchange_rate: @exchange_rate) %>
-
- <%= gettext "Total Gas Used" %> - - <%= cumulative_gas_used(@transaction) %> <%= gettext("Wei") %> -
- <%= gettext "Input" %> - - <%= @transaction.input %> -
+
+

<%= gettext "Transaction Details" %>

+

<%= @transaction %>

+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ <%= gettext "Transaction Status" %> + + <%= formatted_status(@transaction) %> +
+
+ <%= gettext "Block Number" %> + + <% 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) %>) +
+ <%= gettext "Age" %> + + <%= formatted_age(@transaction) %> +
+ <%= gettext "Value" %> + +
<%= value(@transaction) %>
+
<%= formatted_usd_value(@transaction, @exchange_rate) %>
+
+ <%= gettext "From" %> + + <%= 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 %> +
+ <%= gettext "To" %> + + <%= 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 %> +
+ <%= gettext "Nonce" %> + + <%= @transaction.nonce %> +
+
+
+ + + + + <% first_seen = first_seen(@transaction) %> + + + + + <% last_seen = last_seen(@transaction) %> + + + + + + + + + + + + + + + + + + + + + + + +
+ <%= gettext "First Seen" %> + + <%= first_seen %> +
+ <%= gettext "Last Seen" %> + + <%= last_seen %> +
+ <%= gettext "Gas Limit" %> + + <%= format_gas_limit(@transaction.gas) %> <%= gettext("Gas") %> +
+ <%= gettext "Gas Price" %> + + <%= gas_price(@transaction, :wei) %> + (<%= gas_price(@transaction, :gwei) %>) +
+ <%= gettext "TX Fee" %> + +
<%= formatted_fee(@transaction, denomination: :ether) %>
+
<%= formatted_fee(@transaction, exchange_rate: @exchange_rate) %>
+
+ <%= gettext "Total Gas Used" %> + + <%= cumulative_gas_used(@transaction) %> <%= gettext("Wei") %> +
+ <%= gettext "Input" %> + + <%= @transaction.input %> +
+
+
-
+ diff --git a/apps/explorer_web/lib/explorer_web/templates/transaction_internal_transaction/index.html.eex b/apps/explorer_web/lib/explorer_web/templates/transaction_internal_transaction/index.html.eex index 5bebf2bacc..cb88d4a961 100644 --- a/apps/explorer_web/lib/explorer_web/templates/transaction_internal_transaction/index.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/transaction_internal_transaction/index.html.eex @@ -1,6 +1,8 @@ -
+
+ <%= render ExplorerWeb.TransactionView, "overview.html", assigns %> -
+ +
-
-
-
- <%= if length(@internal_transactions.entries) > 0 do %> - - - - - - - - - <%= for transaction <- @internal_transactions do %> - - - - - - - - - - <% end %> -
<%= gettext "Type" %><%= gettext "From" %><%= gettext "To" %><%= gettext "Value" %> (<%= gettext "Ether" %>)<%= gettext "Gas Limit" %> (<%= gettext "Gas" %>)
<%= transaction.call_type %> - <%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> - - <%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> - <%= value(transaction, include_label: false) %><%= gas(transaction) %>
- <% else %> -

<%= gettext "There are no Internal Transactions" %>

- <% end %> +
+
+ <%= if length(@internal_transactions.entries) > 0 do %> + + + + + + + + + <%= for transaction <- @internal_transactions do %> + + + + + + + + + + <% end %> +
<%= gettext "Type" %><%= gettext "From" %><%= gettext "To" %><%= gettext "Value" %> (<%= gettext "Ether" %>)<%= gettext "Gas Limit" %> (<%= gettext "Gas" %>)
<%= transaction.call_type %> + <%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.from_address %> + + <%= render ExplorerWeb.AddressView, "_link.html", conn: @conn, address: transaction.to_address %> + <%= value(transaction, include_label: false) %><%= gas(transaction) %>
+ <% else %> +

<%= gettext "There are no Internal Transactions" %>

+ <% end %> +
-
+
diff --git a/apps/explorer_web/lib/explorer_web/templates/transaction_log/index.html.eex b/apps/explorer_web/lib/explorer_web/templates/transaction_log/index.html.eex index 8b54886823..ca55512b09 100644 --- a/apps/explorer_web/lib/explorer_web/templates/transaction_log/index.html.eex +++ b/apps/explorer_web/lib/explorer_web/templates/transaction_log/index.html.eex @@ -1,6 +1,8 @@ -
+
+ <%= render ExplorerWeb.TransactionView, "overview.html", assigns %> -
+ +
-
-
-
- <%= if length(@logs.entries) > 0 do %> - - - - - - <%= for log <- @logs.entries do %> - - - - - - <% unless is_nil(log.second_topic) do %> - - - +
+
+ <%= if length(@logs.entries) > 0 do %> +
<%= gettext "Address" %><%= gettext "Topic" %>
- <%= link( - log.address, - to: address_path(@conn, :show, @conn.assigns.locale, log.address), - "data-test": "log_address_link", - "data-address-hash": log.address - ) %> - <%= log.first_topic %>
topic[1]<%= log.second_topic %>
+ + + + + <%= for log <- @logs.entries do %> + + + + - <% end %> - <% unless is_nil(log.third_topic) do %> - - - - - <% end %> - <% unless is_nil(log.data) do %> - - - - - <% end %> - - <% end %> -
<%= gettext "Address" %><%= gettext "Topic" %>
+ <%= link( + log.address, + to: address_path(@conn, :show, @conn.assigns.locale, log.address), + "data-test": "log_address_link", + "data-address-hash": log.address + ) %> + <%= log.first_topic %>
topic[2]<%= log.third_topic %>
<%= log.data %>
- <% else %> -

<%= gettext "There are no logs currently." %>

- <% end %> + <% unless is_nil(log.second_topic) do %> + + topic[1] + <%= log.second_topic %> + + <% end %> + <% unless is_nil(log.third_topic) do %> + + topic[2] + <%= log.third_topic %> + + <% end %> + <% unless is_nil(log.data) do %> + + ↠ + <%= log.data %> + + <% end %> + + <% end %> + + <% else %> +

<%= gettext "There are no logs currently." %>

+ <% end %> +
-
+