1
0
Fork 0
mirror of https://github.com/maybe-finance/maybe.git synced 2025-07-19 13:19:39 +02:00

Fix transaction layout alignment regression

This commit is contained in:
Zach Gollwitzer 2025-06-20 13:58:24 -04:00
parent 1aae00f586
commit ab1c17ea14

View file

@ -8,7 +8,7 @@
<%= @focused_record == entry || @focused_record == transaction ? <%= @focused_record == entry || @focused_record == transaction ?
"border border-gray-900 rounded-lg" : "" %>"> "border border-gray-900 rounded-lg" : "" %>">
<div class="pr-4 lg:pr-10 flex items-center gap-3 lg:gap-4 col-span-8 lg:col-span-6"> <div class="pr-4 lg:pr-10 flex items-center gap-3 lg:gap-4 col-span-8 <%= view_ctx == 'global' ? 'lg:col-span-8' : 'lg:col-span-6' %>">
<%= check_box_tag dom_id(entry, "selection"), <%= check_box_tag dom_id(entry, "selection"),
disabled: transaction.transfer.present?, disabled: transaction.transfer.present?,
class: "checkbox checkbox--light", class: "checkbox checkbox--light",
@ -91,20 +91,22 @@
<%= render "transactions/transaction_category", transaction: transaction %> <%= render "transactions/transaction_category", transaction: transaction %>
</div> </div>
<div class="col-span-4 ml-auto text-right"> <div class="col-span-4 lg:col-span-2 ml-auto text-right">
<%= content_tag :p, <%= content_tag :p,
transaction.transfer? && view_ctx == "global" ? "+/- #{format_money(entry.amount_money.abs)}" : format_money(-entry.amount_money), transaction.transfer? && view_ctx == "global" ? "+/- #{format_money(entry.amount_money.abs)}" : format_money(-entry.amount_money),
class: ["text-green-600": entry.amount.negative?] %> class: ["text-green-600": entry.amount.negative?] %>
</div> </div>
<% if view_ctx != "global" %>
<div class="col-span-2 justify-self-end hidden lg:block"> <div class="col-span-2 justify-self-end hidden lg:block">
<% if balance_trend&.trend %> <% if balance_trend&.trend %>
<%= tag.p format_money(balance_trend.trend.current), <%= tag.p format_money(balance_trend.trend.current),
class: "font-medium text-sm text-primary" %> class: "font-medium text-sm text-primary" %>
<% elsif view_ctx != "global" %> <% else %>
<%= tag.p "--", class: "font-medium text-sm text-gray-400" %> <%= tag.p "--", class: "font-medium text-sm text-gray-400" %>
<% end %> <% end %>
</div> </div>
<% end %>
</div> </div>
<% end %> <% end %>
<% end %> <% end %>