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> </ul>
</div> </div>
<div class="card-body"> <div class="card-body">
<%= if Enum.count(@internal_transactions) > 0 do %> <%= if Enum.count(@internal_transactions) > 0 do %>
<div class="dropdown u-float-right u-push-sm"> <div class="dropdown u-float-right u-push-sm">
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" <button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button"

@ -37,44 +37,45 @@
</ul> </ul>
</div> </div>
<div class="card-body"> <div class="card-body">
<div class="dropdown u-float-right u-push-sm"> <%= if Enum.count(@transactions) > 0 do %>
<button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button" <div class="dropdown u-float-right u-push-sm">
id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> <button data-test="filter_dropdown" class="button button--secondary button--xsmall dropdown-toggle" type="button"
Filter: <%= format_current_filter(@filter) %> id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
</button> Filter: <%= format_current_filter(@filter) %>
<div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2"> </button>
<%= link( <div class="dropdown-menu dropdown-menu-right filter" aria-labelledby="dropdownMenu2">
gettext("All"), <%= link(
to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]), gettext("All"),
class: "address__link address__link--active dropdown-item", to: address_transaction_path(@conn, :index, @conn.assigns.locale, @conn.params["address_id"]),
"data-test": "filter_option" class: "address__link address__link--active dropdown-item",
) %> "data-test": "filter_option"
<%= link( ) %>
gettext("To"), <%= link(
to: address_transaction_path( gettext("To"),
@conn, to: address_transaction_path(
:index, @conn,
@conn.assigns.locale, :index,
@conn.params["address_id"], @conn.assigns.locale,
filter: "to" @conn.params["address_id"],
), filter: "to"
class: "address__link address__link--active dropdown-item", ),
"data-test": "filter_option" class: "address__link address__link--active dropdown-item",
) %> "data-test": "filter_option"
<%= link( ) %>
gettext("From"), <%= link(
to: address_transaction_path( gettext("From"),
@conn, to: address_transaction_path(
:index, @conn,
@conn.assigns.locale, :index,
@conn.params["address_id"], @conn.assigns.locale,
filter: "from" @conn.params["address_id"],
), filter: "from"
class: "address__link address__link--active dropdown-item", ),
"data-test": "filter_option" class: "address__link address__link--active dropdown-item",
) %> "data-test": "filter_option"
) %>
</div>
</div> </div>
</div>
<table class="table table-responsive-sm table-font"> <table class="table table-responsive-sm table-font">
<thead> <thead>
@ -132,6 +133,9 @@
<% end %> <% end %>
</tbody> </tbody>
</table> </table>
<% else %>
<p><%= gettext "There are no Transactions" %></p>
<% end %>
</div> </div>
</div> </div>
<%= if @next_page_params do %> <%= if @next_page_params do %>

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

Loading…
Cancel
Save