mirror of
https://github.com/we-promise/sure.git
synced 2026-04-08 14:54:49 +00:00
* [claudesquad] update from 'component-namespacing' on 18 Jul 25 07:23 EDT * [claudesquad] update from 'component-namespacing' on 18 Jul 25 07:30 EDT * Update stimulus controller references to use namespace * Fix remaining tests
55 lines
1.6 KiB
Plaintext
55 lines
1.6 KiB
Plaintext
<%# locals: (account:) %>
|
|
|
|
<div class="grid grid-cols-3 gap-2">
|
|
<%= summary_card title: t(".original_principal") do %>
|
|
<%= format_money account.loan.original_balance %>
|
|
<% end %>
|
|
|
|
<%= summary_card title: t(".remaining_principal") do %>
|
|
<%= format_money account.balance_money %>
|
|
<% end %>
|
|
|
|
<%= summary_card title: t(".interest_rate") do %>
|
|
<% if account.loan.interest_rate.present? %>
|
|
<%= number_to_percentage(account.loan.interest_rate, precision: 3) %>
|
|
<% else %>
|
|
<%= t(".unknown") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= summary_card title: t(".monthly_payment") do %>
|
|
<% if account.loan.rate_type.present? && account.loan.rate_type != 'fixed' %>
|
|
<%= t(".not_applicable") %>
|
|
<% elsif account.loan.rate_type == 'fixed' && account.loan.monthly_payment.present? %>
|
|
<%= format_money(account.loan.monthly_payment) %>
|
|
<% else %>
|
|
<%= t(".unknown") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= summary_card title: t(".term") do %>
|
|
<% if account.loan.term_months.present? %>
|
|
<% if account.loan.term_months < 12 %>
|
|
<%= pluralize(account.loan.term_months, "month") %>
|
|
<% else %>
|
|
<%= pluralize(account.loan.term_months / 12, "year") %>
|
|
<% end %>
|
|
<% else %>
|
|
<%= t(".unknown") %>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<%= summary_card title: t(".type") do %>
|
|
<%= account.loan.rate_type&.titleize || t(".unknown") %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex justify-center py-8">
|
|
<%= render DS::Link.new(
|
|
text: "Edit loan details",
|
|
variant: "ghost",
|
|
href: edit_loan_path(account),
|
|
frame: :modal
|
|
) %>
|
|
</div>
|