1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-27 09:09:41 +02:00

Fix accountable text and alignment (#330)

* Fix #319 Accountable text format

* Fix account index table alignment

* Update to_accountable_title helper

---------

Signed-off-by: Muhammed Kılıç <muhammeddkilicc@gmail.com>
This commit is contained in:
Muhammed Kılıç 2024-02-07 04:48:05 +03:00 committed by GitHub
parent db478e5fbd
commit 6d0e5febe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 8 additions and 5 deletions

View file

@ -1,2 +1,5 @@
module AccountsHelper module AccountsHelper
def to_accountable_title(accountable)
accountable.model_name.human
end
end end

View file

@ -3,14 +3,14 @@
<h3 class="mt-1 mb-4 text-sm text-gray-500"><%#= number_to_currency Current.family.cash_balance %></h3> <h3 class="mt-1 mb-4 text-sm text-gray-500"><%#= number_to_currency Current.family.cash_balance %></h3>
<% Current.family.accounts.each do |account| %> <% Current.family.accounts.each do |account| %>
<div class="flex items-center justify-between px-3 py-3 mb-2 bg-white shadow-sm rounded-xl"> <div class="flex flex-row items-center justify-between px-3 py-3 mb-2 bg-white shadow-sm rounded-xl">
<div class="flex items-center text-sm"> <div class="flex w-1/3 items-center text-sm">
<%= account.name %> <%= account.name %>
</div> </div>
<div class="flex items-center text-sm"> <div class="flex w-1/3 items-center text-sm">
<%= account.accountable.model_name.human %> <%= to_accountable_title(account.accountable) %>
</div> </div>
<p class="text-sm text-right"> <p class="flex w-1/3 text-sm text-right">
<span class="block mb-1"><%= humanized_money_with_symbol account.balance %></span> <span class="block mb-1"><%= humanized_money_with_symbol account.balance %></span>
</p> </p>
</div> </div>