@ -14,41 +14,63 @@
<%= format_token_amount(@delegator.stake_amount, @token) %>
<%= format_token_amount(@delegator.stake_amount, @token) %>
</span>
</span>
</p>
</p>
<%= if Decimal.positive?(@delegator.ordered_withdraw) do %>
<%
withdraw_now_allowed = Decimal.positive?(@delegator.max_withdraw_allowed)
order_allowed = Decimal.positive?(@delegator.max_ordered_withdraw_allowed)
has_already_ordered = Decimal.positive?(@delegator.ordered_withdraw)
show_order_withdrawal = order_allowed or has_already_ordered
%>
<% # display available amounts %>
<%= if has_already_ordered do %>
<p class="form-p m-b-0"><%= gettext("Already Ordered:") %>
<p class="form-p m-b-0"><%= gettext("Already Ordered:") %>
<span class="text-dark">
<span class="text-dark">
<%= format_token_amount(@delegator.ordered_withdraw, @token) %>
<%= format_token_amount(@delegator.ordered_withdraw, @token) %>
</span>
</span>
</p>
</p>
<% end %>
<% end %>
<%= if Decimal.positive?(@delegator.max_ordered_withdraw_allowed) or Decimal.positive?(@delegator.ordered_withdraw) do %>
<%= if show_order_withdrawal do %>
<div class="form-p m-b-0-7"><%= gettext("You Can Order:") %>
<div class="form-p m-b-0<%= if not withdraw_now_allowed, do: "-7" %>"><%= gettext("You Can Order:") %>
<%= if order_allowed do %>
<span class="text-dark link-dotted" data-available-amount="<%= from_wei(@delegator.max_ordered_withdraw_allowed, @token) %>">
<span class="text-dark link-dotted" data-available-amount="<%= from_wei(@delegator.max_ordered_withdraw_allowed, @token) %>">
<%= format_token_amount(@delegator.max_ordered_withdraw_allowed, @token) %>
<%= format_token_amount(@delegator.max_ordered_withdraw_allowed, @token) %>
</span>
</span>
<%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip.html", text: gettext("The amount can be claimed after the current epoch finishes.") %>
<%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip.html", text: gettext("The amount can be claimed after the current epoch finishes.") %>
<% else %>
<span class="text-dark">
<%= format_token_amount(@delegator.max_ordered_withdraw_allowed, @token) %>
</span>
<% end %>
</div>
</div>
<%=
render BlockScoutWeb.StakesView,
"_stakes_btn_withdraw.html",
text: gettext("Order Withdrawal"),
extra_class: "full-width btn-add-full order-withdraw"
%>
<% end %>
<% end %>
<%= if Decimal.positive?(@delegator.max_ withdraw_allowed) do %>
<%= if withdraw_now_allowed do %>
<div class="form-p m-b-0-7"><%= gettext("Available Now:") %>
<div class="form-p m-b-0-7"><%= gettext("Available Now:") %>
<span class="text-dark link-dotted" data-available-amount="<%= from_wei(@delegator.max_withdraw_allowed, @token) %>">
<span class="text-dark link-dotted" data-available-amount="<%= from_wei(@delegator.max_withdraw_allowed, @token) %>">
<%= format_token_amount(@delegator.max_withdraw_allowed, @token) %>
<%= format_token_amount(@delegator.max_withdraw_allowed, @token) %>
</span>
</span>
<%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip.html", text: gettext("You can withdraw this amount right now.") %>
<%= render BlockScoutWeb.CommonComponentsView, "_i_tooltip.html", text: gettext("You can withdraw this amount right now.") %>
</div>
</div>
<% end %>
<% # display buttons %>
<%=
if show_order_withdrawal do
bottom_margin = if withdraw_now_allowed, do: " m-b-0-7", else: ""
render BlockScoutWeb.StakesView,
"_stakes_btn_withdraw.html",
text: gettext("Order Withdrawal"),
extra_class: "full-width btn-add-full order-withdraw" <> bottom_margin
end
%>
<%=
<%=
if withdraw_now_allowed do
render BlockScoutWeb.StakesView,
render BlockScoutWeb.StakesView,
"_stakes_btn_withdraw.html",
"_stakes_btn_withdraw.html",
text: gettext("Withdraw Now"),
text: gettext("Withdraw Now"),
extra_class: "full-width btn-add-full withdraw"
extra_class: "full-width btn-add-full withdraw"
end
%>
%>
<% end %>
</form>
</form>
</div>
</div>
<%= render BlockScoutWeb.CommonComponentsView, "_modal_bottom_disclaimer.html", text: gettext("<p>Pending stake (stake placed on a candidate pool or placed during the current staking epoch) may be withdrawn now.</p>
<%= render BlockScoutWeb.CommonComponentsView, "_modal_bottom_disclaimer.html", text: gettext("<p>Pending stake (stake placed on a candidate pool or placed during the current staking epoch) may be withdrawn now.</p>