Skip to content

armgit / maybe

Public Imported from GitHub
0

The personal finance app for everyone

Fix transaction layout alignment regression

Zach Gollwitzerab1c17ea1460
diff --git a/app/views/transactions/_transaction.html.erb b/app/views/transactions/_transaction.html.erb
index b36e854b..d84f3369 100644
--- a/app/views/transactions/_transaction.html.erb
+++ b/app/views/transactions/_transaction.html.erb
@@ -8,7 +8,7 @@
<%= @focused_record == entry || @focused_record == transaction ?
"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"),
disabled: transaction.transfer.present?,
class: "checkbox checkbox--light",
@@ -91,20 +91,22 @@
<%= render "transactions/transaction_category", transaction: transaction %>
</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,
transaction.transfer? && view_ctx == "global" ? "+/- #{format_money(entry.amount_money.abs)}" : format_money(-entry.amount_money),
class: ["text-green-600": entry.amount.negative?] %>
</div>
- <div class="col-span-2 justify-self-end hidden lg:block">
- <% if balance_trend&.trend %>
- <%= tag.p format_money(balance_trend.trend.current),
+ <% if view_ctx != "global" %>
+ <div class="col-span-2 justify-self-end hidden lg:block">
+ <% if balance_trend&.trend %>
+ <%= tag.p format_money(balance_trend.trend.current),
class: "font-medium text-sm text-primary" %>
- <% elsif view_ctx != "global" %>
- <%= tag.p "--", class: "font-medium text-sm text-gray-400" %>
- <% end %>
- </div>
+ <% else %>
+ <%= tag.p "--", class: "font-medium text-sm text-gray-400" %>
+ <% end %>
+ </div>
+ <% end %>
</div>
<% end %>
<% end %>