2024-11-04 20:27:31 -05:00
|
|
|
<%= drawer do %>
|
|
|
|
<header class="mb-4 space-y-1">
|
|
|
|
<div class="flex items-center gap-4">
|
|
|
|
<h3 class="font-medium">
|
|
|
|
<span class="text-2xl">
|
2025-01-07 09:41:24 -05:00
|
|
|
<%= format_money @transfer.amount_abs %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</span>
|
|
|
|
|
2025-02-13 11:31:07 -05:00
|
|
|
<span class="text-lg text-secondary">
|
2025-01-07 09:41:24 -05:00
|
|
|
<%= @transfer.amount_abs.currency.iso_code %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</span>
|
|
|
|
</h3>
|
|
|
|
|
2025-02-13 11:31:07 -05:00
|
|
|
<%= lucide_icon "arrow-left-right", class: "text-secondary mt-1 w-5 h-5" %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</div>
|
|
|
|
|
2025-02-13 11:31:07 -05:00
|
|
|
<span class="text-sm text-secondary">
|
2024-11-04 20:27:31 -05:00
|
|
|
<%= @transfer.name %>
|
|
|
|
</span>
|
|
|
|
</header>
|
|
|
|
|
|
|
|
<div class="space-y-2">
|
|
|
|
<!-- Overview Section -->
|
|
|
|
<%= disclosure t(".overview") do %>
|
2025-02-13 11:31:07 -05:00
|
|
|
<div class="pb-4 px-3 pt-2 text-sm space-y-3 text-primary">
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="space-y-3">
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">From</dt>
|
2024-11-04 20:27:31 -05:00
|
|
|
<dd class="flex items-center gap-2 font-medium">
|
2025-01-07 09:41:24 -05:00
|
|
|
<%= render "accounts/logo", account: @transfer.from_account, size: "sm" %>
|
|
|
|
<%= link_to @transfer.from_account.name, account_path(@transfer.from_account), data: { turbo_frame: "_top" } %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">Date</dt>
|
2025-01-07 09:41:24 -05:00
|
|
|
<dd class="font-medium"><%= l(@transfer.outflow_transaction.entry.date, format: :long) %></dd>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dl>
|
|
|
|
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">Amount</dt>
|
2025-02-21 11:57:59 -05:00
|
|
|
<dd class="font-medium text-red-500"><%= format_money @transfer.outflow_transaction.entry.amount_money * -1 %></dd>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div class="bg-alpha-black-100 h-px my-2"></div>
|
|
|
|
|
|
|
|
<div class="space-y-3">
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">To</dt>
|
2024-11-04 20:27:31 -05:00
|
|
|
<dd class="flex items-center gap-2 font-medium">
|
2025-01-07 09:41:24 -05:00
|
|
|
<%= render "accounts/logo", account: @transfer.to_account, size: "sm" %>
|
|
|
|
<%= link_to @transfer.to_account.name, account_path(@transfer.to_account), data: { turbo_frame: "_top" } %>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dd>
|
|
|
|
</dl>
|
|
|
|
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">Date</dt>
|
2025-01-07 09:41:24 -05:00
|
|
|
<dd class="font-medium"><%= l(@transfer.inflow_transaction.entry.date, format: :long) %></dd>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dl>
|
|
|
|
|
|
|
|
<dl class="flex items-center gap-2 justify-between">
|
2025-02-13 11:31:07 -05:00
|
|
|
<dt class="text-secondary">Amount</dt>
|
2025-02-21 11:57:59 -05:00
|
|
|
<dd class="font-medium text-green-500">+<%= format_money @transfer.inflow_transaction.entry.amount_money * -1 %></dd>
|
2024-11-04 20:27:31 -05:00
|
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<!-- Details Section -->
|
|
|
|
<%= disclosure t(".details") do %>
|
|
|
|
<%= styled_form_with model: @transfer,
|
2025-01-16 14:36:37 -05:00
|
|
|
data: { controller: "auto-submit-form" }, class: "space-y-2" do |f| %>
|
|
|
|
<% if @transfer.categorizable? %>
|
|
|
|
<%= f.collection_select :category_id, @categories.alphabetically, :id, :name, { label: "Category", include_blank: "Uncategorized", selected: @transfer.outflow_transaction.category&.id }, "data-auto-submit-form-target": "auto" %>
|
|
|
|
<% end %>
|
|
|
|
|
2024-11-04 20:27:31 -05:00
|
|
|
<%= f.text_area :notes,
|
|
|
|
label: t(".note_label"),
|
|
|
|
placeholder: t(".note_placeholder"),
|
|
|
|
rows: 5,
|
|
|
|
"data-auto-submit-form-target": "auto" %>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
|
|
|
|
<!-- Settings Section -->
|
|
|
|
<%= disclosure t(".settings") do %>
|
|
|
|
<div class="pb-4">
|
|
|
|
<div class="flex items-center justify-between gap-2 p-3">
|
|
|
|
<div class="text-sm space-y-1">
|
2025-02-13 11:31:07 -05:00
|
|
|
<h4 class="text-primary"><%= t(".delete_title") %></h4>
|
|
|
|
<p class="text-secondary"><%= t(".delete_subtitle") %></p>
|
2024-11-04 20:27:31 -05:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<%= button_to t(".delete"),
|
2025-01-07 09:41:24 -05:00
|
|
|
transfer_path(@transfer),
|
2024-11-04 20:27:31 -05:00
|
|
|
method: :delete,
|
2025-01-07 09:41:24 -05:00
|
|
|
class: "rounded-lg px-3 py-2 whitespace-nowrap text-red-500 text-sm
|
2025-02-13 11:31:07 -05:00
|
|
|
font-medium border border-secondary",
|
2024-11-04 20:27:31 -05:00
|
|
|
data: { turbo_confirm: true, turbo_frame: "_top" } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|