Blockchain explorer for Ethereum based network and a tool for inspecting and analyzing EVM based blockchains.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
blockscout/lib/explorer_web/templates/block/index.html.eex

34 lines
2.5 KiB

<section class="container__section">
<div class="blocks__headline">
<h1 class="blocks__headline-title"><%= gettext("Showing #%{start_block} to #%{end_block}", start_block: List.last(@blocks.entries).number, end_block: List.first(@blocks.entries).number) %></h1>
<div class="blocks__pagination"><%= pagination_links @conn, @blocks, ["en"], view_style: :bulma, first: true, distance: 1, previous: Phoenix.HTML.raw("&lsaquo;"), next: Phoenix.HTML.raw("&rsaquo;"), path: &block_path/4 %></div>
</div>
<div class="blocks">
<div class="blocks__container">
<table class="blocks__table">
<thead class="blocks__header">
<tr>
<th class="blocks__column-header"><%= gettext "Height" %></th>
<th class="blocks__column-header"><%= gettext "Age" %></th>
<th class="blocks__column-header"><%= gettext "Transactions" %></th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Used" %></th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Limit" %></th>
<th class="blocks__column-header blocks__column-header--optional"><%= gettext "Gas Price" %></th>
</tr>
</thead>
<tbody>
<%= for block <- @blocks do %>
<tr class="blocks__row">
<td class="blocks__column blocks__column--height"><%= link(block.number, to: block_path(@conn, :show, @conn.assigns.locale, block.number), class: "blocks__link") %></td>
<td class="transactions__column transactions__column--age"><%= block.timestamp |> Timex.from_now %></td>
<td class="blocks__column blocks__column--transactions-count"><%= gettext("%{count} transactions", count: block.transactions |> Enum.count) %></td>
<td class="blocks__column blocks__column--optional blocks__column--gas-used"><%= block.gas_used |> Cldr.Number.to_string! %> (<%= block.gas_used / block.gas_limit |> Cldr.Number.to_string!(format: "#.#%") %>)</td>
<td class="blocks__column blocks__column--optional blocks__column--gas-limit"><%= block.gas_limit |> Cldr.Number.to_string! %></td>
<td class="blocks__column blocks__column--optional blocks__column--gas-price"><%= block.transactions |> Enum.map(fn(transaction) -> Decimal.to_float(Decimal.div(Decimal.new(transaction.gas_price), Decimal.new(1_000_000_000))) end) |> Math.Enum.mean || 0 |> Cldr.Number.to_string! %> Gwei</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</section>