From 9d1553304e08ad6fb7d220b29e4f0ae4302232c3 Mon Sep 17 00:00:00 2001 From: Eduard Sachava Date: Mon, 11 Nov 2019 18:06:33 +0200 Subject: [PATCH] =?UTF-8?q?Display=20=E2=80=9CAccounted=20Stake=20Amount?= =?UTF-8?q?=E2=80=9D=20and=20=E2=80=9CCurrent=20Reward=20Percent=E2=80=9D?= =?UTF-8?q?=20in=20delegators=20list?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../assets/css/components/_stakes_table.scss | 1 + .../_stakes_modal_delegators_list.html.eex | 17 ++++++++++++----- .../templates/stakes/_stakes_th.html.eex | 2 +- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/apps/block_scout_web/assets/css/components/_stakes_table.scss b/apps/block_scout_web/assets/css/components/_stakes_table.scss index 38a46f1618..ded5ae30f0 100644 --- a/apps/block_scout_web/assets/css/components/_stakes_table.scss +++ b/apps/block_scout_web/assets/css/components/_stakes_table.scss @@ -118,6 +118,7 @@ $stakes-link-color: $primary !default; .stakes-th-text { margin-right: 10px; white-space: nowrap; + text-align: center; } .stakes-td { diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex index 0b438e88e3..1fb85bea15 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_modal_delegators_list.html.eex @@ -13,14 +13,14 @@ <%= render BlockScoutWeb.StakesView, "_stakes_th.html", title: gettext("Staker's Address"), tooltip: gettext("All pool participant addresses. The top address belongs to the validator.") %>
- <%= render BlockScoutWeb.StakesView, "_stakes_th.html", title: gettext("Total Stake Amount"), tooltip: gettext("Amount of STAKE placed by an address") %> + <%= render BlockScoutWeb.StakesView, "_stakes_th.html", title: gettext("Current Stake Amount") <> "
(" <> gettext("Accounted Stake Amount") <> ")", tooltip: gettext("Amount of STAKE placed by an address") %>
<%= - title = if @pool.is_validator do gettext("Reward Percent") else gettext("Potential Reward Percent") end + _title = if @pool.is_validator do gettext("Reward Percent") else gettext("Potential Reward Percent") end render BlockScoutWeb.StakesView, "_stakes_th.html", - title: title, + title: gettext("Potential Reward Percent") <> "
(" <> gettext("Current Reward Percent") <> ")", tooltip: gettext("Reward distribution is based on stake amount. Validator receives a minimum of 30%.") %>
@@ -52,8 +52,15 @@ <% end %> -
<%= format_token_amount(delegator.stake_amount, @token, symbol: false) %>
-
<%= if delegator.reward_ratio do "#{delegator.reward_ratio}%" else "-" end %>
+
<%= format_token_amount(delegator.stake_amount, @token, symbol: false) %> (<%= if delegator.snapshotted_stake_amount do format_token_amount(delegator.snapshotted_stake_amount, @token, symbol: false) else 0 end %>)
+
+ <%= if delegator.reward_ratio do %> + <%= delegator.reward_ratio %>% + (<%= if delegator.snapshotted_reward_ratio do "#{delegator.snapshotted_reward_ratio}%" else "0%" end %>) + <% else %> + - + <% end %> +
<% end %> diff --git a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_th.html.eex b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_th.html.eex index bb44f76e91..4a703cfe54 100644 --- a/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_th.html.eex +++ b/apps/block_scout_web/lib/block_scout_web/templates/stakes/_stakes_th.html.eex @@ -1,6 +1,6 @@
- <%= @title %> + <%= raw(@title) %> <%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip.html", text: @tooltip %>
\ No newline at end of file