From 4dbea96a3501c548ad04b85d736e4732688d8b9e Mon Sep 17 00:00:00 2001 From: Vamsi Krishna B Date: Tue, 20 Jul 2021 19:04:20 +0530 Subject: [PATCH] Few usability improvements - TX confirmations, fix TX inputs on mobile view --- .../controllers/page_controller.ex | 4 +++ .../live/raw_mempool_live.ex | 6 +--- lib/zcash_explorer_web/router.ex | 1 + .../templates/layout/app.html.eex | 4 +-- .../templates/page/nodes.html.eex | 8 +++++ .../templates/transaction/tx.html.eex | 34 ++++++++----------- 6 files changed, 31 insertions(+), 26 deletions(-) create mode 100644 lib/zcash_explorer_web/templates/page/nodes.html.eex diff --git a/lib/zcash_explorer_web/controllers/page_controller.ex b/lib/zcash_explorer_web/controllers/page_controller.ex index 4412aa9..9774830 100644 --- a/lib/zcash_explorer_web/controllers/page_controller.ex +++ b/lib/zcash_explorer_web/controllers/page_controller.ex @@ -74,4 +74,8 @@ defmodule ZcashExplorerWeb.PageController do def mempool(conn, _params) do render(conn, "mempool.html", page_title: "Zcash Mempool") end + + def nodes(conn, _params) do + render(conn, "nodes.html", page_title: "Zcash Nodes") + end end diff --git a/lib/zcash_explorer_web/live/raw_mempool_live.ex b/lib/zcash_explorer_web/live/raw_mempool_live.ex index f202a3e..cac56d8 100644 --- a/lib/zcash_explorer_web/live/raw_mempool_live.ex +++ b/lib/zcash_explorer_web/live/raw_mempool_live.ex @@ -3,7 +3,7 @@ defmodule ZcashExplorerWeb.RawMempoolLive do def render(assigns) do ~L""" -
+
@@ -12,7 +12,6 @@ defmodule ZcashExplorerWeb.RawMempoolLive do - @@ -35,9 +34,6 @@ defmodule ZcashExplorerWeb.RawMempoolLive do - <% end %> diff --git a/lib/zcash_explorer_web/router.ex b/lib/zcash_explorer_web/router.ex index 773ed65..d9feaec 100644 --- a/lib/zcash_explorer_web/router.ex +++ b/lib/zcash_explorer_web/router.ex @@ -38,6 +38,7 @@ defmodule ZcashExplorerWeb.Router do get "/search", SearchController, :search get "/blocks", BlockController, :index get "/mempool", PageController, :mempool + get "/nodes", PageController, :nodes end # Other scopes may use custom stacks. diff --git a/lib/zcash_explorer_web/templates/layout/app.html.eex b/lib/zcash_explorer_web/templates/layout/app.html.eex index 4fc5a85..1c513c3 100644 --- a/lib/zcash_explorer_web/templates/layout/app.html.eex +++ b/lib/zcash_explorer_web/templates/layout/app.html.eex @@ -6,12 +6,12 @@ diff --git a/lib/zcash_explorer_web/templates/page/nodes.html.eex b/lib/zcash_explorer_web/templates/page/nodes.html.eex new file mode 100644 index 0000000..254ab31 --- /dev/null +++ b/lib/zcash_explorer_web/templates/page/nodes.html.eex @@ -0,0 +1,8 @@ +
+
+

+ Zcash Nodes +

+ <%= live_render(@conn, ZcashExplorerWeb.RawMempoolLive) %> +
+
\ No newline at end of file diff --git a/lib/zcash_explorer_web/templates/transaction/tx.html.eex b/lib/zcash_explorer_web/templates/transaction/tx.html.eex index 1550b51..4a586d4 100644 --- a/lib/zcash_explorer_web/templates/transaction/tx.html.eex +++ b/lib/zcash_explorer_web/templates/transaction/tx.html.eex @@ -11,27 +11,13 @@
-
-
- Hash (txid) -
-
- <%= @tx.txid %> -
-
-
-
- Time (UTC) -
-
- <%= ZcashExplorerWeb.BlockView.mined_time(@tx.time) %> -
-
+ +
Confirmations
-
+
<%= if @tx.confirmations == nil do %> 0 <% else %> @@ -40,6 +26,16 @@
+ +
+
+ Time (UTC) +
+
+ <%= ZcashExplorerWeb.BlockView.mined_time(@tx.time) %> +
+
+
@@ -106,7 +102,7 @@
- size + Size (bytes)
<%= @tx.size %> @@ -149,7 +145,7 @@ Inputs (<%= vin_count(@tx.vin) %>)
  • Time Fee SizeCurrentpriority
    <%= tx["info"]["size"] %> - <%= tx["info"]["currentpriority"] %> -