Hide table display if no transactions exist

pull/320/head
Stamates 7 years ago
parent 027ad14df0
commit bb84d7703f
  1. 1
      apps/explorer_web/lib/explorer_web/templates/address_internal_transaction/index.html.eex
  2. 78
      apps/explorer_web/lib/explorer_web/templates/address_transaction/index.html.eex
  3. 2
      apps/explorer_web/lib/explorer_web/templates/transaction_log/index.html.eex

@ -37,7 +37,6 @@
</ul>
</div>
<div class="card-body">
<%= if Enum.count(@internal_transactions) > 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"

@ -37,44 +37,45 @@
</ul>
</div>
<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"
) %>
<%= if Enum.count(@transactions) > 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_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>
</div>
<table class="table table-responsive-sm table-font">
<thead>
@ -132,6 +133,9 @@
<% end %>
</tbody>
</table>
<% else %>
<p><%= gettext "There are no Transactions" %></p>
<% end %>
</div>
</div>
<%= if @next_page_params do %>

@ -64,7 +64,7 @@
<% end %>
</table>
<% else %>
<p><%= gettext "There are no logs currently." %></p>
<p><%= gettext "There are no logs currently." %></p>
<% end %>
</div>
</div>

Loading…
Cancel
Save