pull/1999/head
Ayrat Badykov 6 years ago
parent ad333aac7f
commit cb4354c601
No known key found for this signature in database
GPG Key ID: B44668E265E9396F
  1. 32
      apps/block_scout_web/lib/block_scout_web/controllers/address_controller.ex
  2. 4
      apps/block_scout_web/lib/block_scout_web/templates/address/index.html.eex

@ -33,24 +33,26 @@ defmodule BlockScoutWeb.AddressController do
exchange_rate = Market.get_exchange_rate(Explorer.coin()) || Token.null() exchange_rate = Market.get_exchange_rate(Explorer.coin()) || Token.null()
total_supply = Chain.total_supply() total_supply = Chain.total_supply()
items =
addresses_page
|> Enum.with_index(1)
|> Enum.map(fn {{address, tx_count}, index} ->
View.render_to_string(
AddressView,
"_tile.html",
address: address,
index: index,
exchange_rate: exchange_rate,
total_supply: total_supply,
tx_count: tx_count,
validation_count: validation_count(address)
)
end)
json( json(
conn, conn,
%{ %{
items: items: items,
addresses_page
|> Enum.with_index(1)
|> Enum.map(fn {{address, tx_count}, index} ->
View.render_to_string(
AddressView,
"_tile.html",
address: address,
index: index,
exchange_rate: exchange_rate,
total_supply: total_supply,
tx_count: tx_count,
validation_count: validation_count(address)
)
end),
next_page_path: next_page_path next_page_path: next_page_path
} }
) )

@ -1,11 +1,11 @@
<section class="container"> <section class="container">
<div class="card"> <div class="card">
<div class="card-body" data-async-listing="<%= @current_path %>"> <div class="card-body" data-async-load data-async-listing="<%= @current_path %>">
<h1 class="card-title"><%= gettext "Addresses" %></h1> <h1 class="card-title"><%= gettext "Addresses" %></h1>
<%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %> <%= render BlockScoutWeb.CommonComponentsView, "_pagination_container.html", position: "top", cur_page_number: "1", show_pagination_limit: true, data_next_page_button: true %>
<div data-selector="top-addresses-list"></div> <div data-items data-selector="top-addresses-list"></div>
<div data-loading-message class="tile tile-muted text-center mt-3" style="display: none;"> <div data-loading-message class="tile tile-muted text-center mt-3" style="display: none;">
<span class="loading-spinner-small mr-2"> <span class="loading-spinner-small mr-2">

Loading…
Cancel
Save