(fix) text format

pull/1844/head
Gabriel Rodriguez Alsina 6 years ago
parent 654d8cf212
commit 313922d93b
  1. 43
      apps/block_scout_web/lib/block_scout_web/templates/block/overview.html.eex
  2. 2
      apps/block_scout_web/lib/block_scout_web/templates/transaction/overview.html.eex

@ -33,18 +33,18 @@
<!-- Block Hash --> <!-- Block Hash -->
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Hash" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Hash" %></dt>
<dd class="col-sm-9"> <%= to_string(@block.hash) %> </dd> <dd class="col-sm-9"><a class="transaction__link"><%= to_string(@block.hash) %></a></dd>
</dl> </dl>
<%= unless @block.number == 0 do %> <%= unless @block.number == 0 do %>
<!-- Parent Hash --> <!-- Parent Hash -->
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Parent Hash" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Parent Hash" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<%= link( <%= link(
@block.parent_hash, @block.parent_hash,
class: "block__link", class: "transaction__link",
to: block_path(@conn, :show, @block.number - 1) to: block_path(@conn, :show, @block.number - 1)
) %> ) %>
</dd> </dd>
@ -53,34 +53,34 @@
<!-- Difficulty value --> <!-- Difficulty value -->
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Difficulty" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Difficulty" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<%= @block.difficulty |> Cldr.Number.to_string! %> <span class="font-weight-bold"><%= @block.difficulty |> Cldr.Number.to_string! %></span>
</dd> </dd>
</dl> </dl>
<%= if block_type(@block) == "Block" do %> <%= if block_type(@block) == "Block" do %>
<!-- Total Difficulty --> <!-- Total Difficulty -->
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Total Difficulty" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Total Difficulty" %></dt>
<dd class="col-sm-9"> <%= @block.total_difficulty |> Cldr.Number.to_string! %> </dd> <dd class="col-sm-9"><span class="font-weight-bold"><%= @block.total_difficulty |> Cldr.Number.to_string! %></span></dd>
</dl> </dl>
<!-- Nonce --> <!-- Nonce -->
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Nonce" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Nonce" %></dt>
<dd class="col-sm-9"> <%= to_string(@block.nonce) %> </dd> <dd class="col-sm-9"><span class="font-weight-bold"><%= to_string(@block.nonce) %></span></dd>
</dl> </dl>
<%= if length(@block.uncle_relations) > 0 do %> <%= if length(@block.uncle_relations) > 0 do %>
<!-- Uncles --> <!-- Uncles -->
<dl class="row mt-3"> <dl class="row mt-3">
<dt class="col-sm-3 text-muted"> <%= gettext "Uncles" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Uncles" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<%= for {relation, index} <- Enum.with_index(@block.uncle_relations) do %> <%= for {relation, index} <- Enum.with_index(@block.uncle_relations) do %>
<%= link( <%= link(
gettext("Position %{index}", index: index), gettext("Position %{index}", index: index),
class: "block__link", class: "transaction__link",
"data-test": "uncle_link", "data-test": "uncle_link",
"data-uncle-hash": to_string(relation.uncle_hash), "data-uncle-hash": to_string(relation.uncle_hash),
to: block_path(@conn, :show, relation.uncle_hash) to: block_path(@conn, :show, relation.uncle_hash)
@ -95,14 +95,14 @@
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt> <dt class="col-sm-3 text-muted"><%= gettext "Gas Used" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<%= @block.gas_used |> Cldr.Number.to_string! %> <span class="font-weight-bold"><%= @block.gas_used |> Cldr.Number.to_string! %></span>
<span class="text-muted"> (<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>) </span> <span class="text-muted">(<%= (Decimal.to_integer(@block.gas_used) / Decimal.to_integer(@block.gas_limit)) |> Cldr.Number.to_string!(format: "#.#%") %>)</span>
</dt> </dt>
</dl> </dl>
<dl class="row mb-0"> <dl class="row mb-0">
<dt class="col-sm-3 text-muted"><%= gettext "Gas Limit" %></dt> <dt class="col-sm-3 text-muted"><%= gettext "Gas Limit" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<%= Cldr.Number.to_string!(@block.gas_limit) %> <span class="font-weight-bold"><%= Cldr.Number.to_string!(@block.gas_limit) %></span>
</dd> </dd>
</dl> </dl>
<% end %> <% end %>
@ -135,14 +135,11 @@
<div class="card-body card-body-flex-column-space-between"> <div class="card-body card-body-flex-column-space-between">
<%= if show_reward?(@block.rewards) do %> <%= if show_reward?(@block.rewards) do %>
<h2 class="card-title balance-card-title"><%= gettext "Block Rewards" %></h2> <h2 class="card-title balance-card-title"><%= gettext "Block Rewards" %></h2>
<%= for block_reward <- @block.rewards do %> <div class="text-right">
<dl class="row"> <%= for block_reward <- @block.rewards do %>
<dt class="col-sm-5 text-muted"><%= block_reward_text(block_reward) %></dt> <p class="address-current-balance"><%= block_reward_text(block_reward) %> <span class="text-muted"><%= format_wei_value(block_reward.reward, :ether) %></span></p>
<dd class="col-sm-7"> <% end %>
<%= format_wei_value(block_reward.reward, :ether) %></dt> </div>
</dd>
</dl>
<% end %>
<% else %> <% else %>
<h2 class="card-title balance-card-title"><%= gettext "Gas Used" %></h2> <h2 class="card-title balance-card-title"><%= gettext "Gas Used" %></h2>
<div class="text-right"> <div class="text-right">

@ -67,7 +67,7 @@
</dd> </dd>
</dl> </dl>
<dl class="row"> <dl class="row">
<dt class="col-sm-3 text-muted"> <%= gettext "Block Confirmations" %> </dt> <dt class="col-sm-3 text-muted"><%= gettext "Block Confirmations" %></dt>
<dd class="col-sm-9"> <dd class="col-sm-9">
<span data-selector="block-confirmations" class="font-weight-bold"><%= confirmations(@transaction, block_height: @block_height) %></span> <span data-selector="block-confirmations" class="font-weight-bold"><%= confirmations(@transaction, block_height: @block_height) %></span>
</dd> </dd>

Loading…
Cancel
Save