Refactor template for first page async load

pull/1116/head
William Sanches 6 years ago
parent e5d7fae2e3
commit 87f1118507
No known key found for this signature in database
GPG Key ID: 27250E49FB133014
  1. 57
      apps/block_scout_web/lib/block_scout_web/templates/address_token_transfer/index.html.eex

@ -7,41 +7,36 @@
<%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %> <%= render BlockScoutWeb.AddressView, "_tabs.html", assigns %>
</div> </div>
<div class="card-body"> <div data-async-listing="<%= @current_path %>" class="card-body">
<h2 class="card-title"> <h2 class="card-title">
<span class="text-muted"><%= gettext "Tokens" %></span> / <%= token_name(@token) %> <span class="text-muted"><%= gettext "Tokens" %></span> / <%= token_name(@token) %>
</h2> </h2>
<div data-loading-message class="tile tile-muted text-center mt-3">
<%= if Enum.any?(@transactions) do %> <span class="loading-spinner-small mr-2">
<span data-selector="transactions-list"> <span class="loading-spinner-block-1"></span>
<%= for transaction <- @transactions do %> <span class="loading-spinner-block-2"></span>
<%= render(
BlockScoutWeb.TransactionView,
"_tile.html",
transaction: transaction,
current_address: @address
) %>
<% end %>
</span> </span>
<% else %> <%= gettext("Loading...") %>
<div class="tile tile-muted text-center"> </div>
<span><%= gettext "There are no token transfers for this address." %></span> <div data-empty-response-message class="tile tile-muted text-center" style="display: none;">
</div> <span><%= gettext "There are no token transfers for this address." %></span>
<% end %> </div>
<button data-error-message class="alert alert-danger col-12 text-left" style="display: none;">
<%= if @next_page_params do %> <span class="alert-link">
<%= link( <%= gettext "Something went wrong, click to reload." %>
gettext("Next"), </span>
class: "button button-secondary button-sm float-right mt-3", </button>
to: address_token_transfers_path( <div data-items></div>
@conn, <a data-next-page-button href="#" class="button button-secondary button-small float-right mt-4" style="display: none;">
:index, <%= gettext("Older") %>
@address.hash, </a>
@token.contract_address_hash, <div data-loading-button class="button button-secondary button-small float-right mt-4" style="display: none;">
@next_page_params <span class="loading-spinner-small mr-2">
) <span class="loading-spinner-block-1"></span>
) %> <span class="loading-spinner-block-2"></span>
<% end %> </span>
<%= gettext("Loading") %>...
</div>
</div> </div>
</div> </div>
</section> </section>

Loading…
Cancel
Save