2024-11-04 20:27:31 -05:00
|
|
|
<% entry, account = @entry, @entry.account %>
|
2024-08-09 11:22:57 -04:00
|
|
|
|
2025-04-30 18:14:22 -04:00
|
|
|
<%= render DialogComponent.new(variant: "drawer") do |dialog| %>
|
|
|
|
<% dialog.with_header do %>
|
|
|
|
<%= render "valuations/header", entry: @entry %>
|
|
|
|
<% end %>
|
2024-11-04 20:27:31 -05:00
|
|
|
|
2025-04-30 18:14:22 -04:00
|
|
|
<% dialog.with_body do %>
|
2025-07-03 09:33:07 -04:00
|
|
|
<% if @error_message.present? %>
|
|
|
|
<div class="mb-4">
|
|
|
|
<%= render AlertComponent.new(message: @error_message, variant: :error) %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2025-04-30 18:14:22 -04:00
|
|
|
<% dialog.with_section(title: t(".overview"), open: true) do %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="pb-4">
|
2024-11-27 16:01:50 -05:00
|
|
|
<%= styled_form_with model: entry,
|
2025-04-14 11:40:34 -04:00
|
|
|
url: entry_path(entry),
|
2024-11-04 20:27:31 -05:00
|
|
|
class: "space-y-2",
|
|
|
|
data: { controller: "auto-submit-form" } do |f| %>
|
|
|
|
<%= f.date_field :date,
|
|
|
|
label: t(".date_label"),
|
|
|
|
max: Date.current,
|
|
|
|
"data-auto-submit-form-target": "auto" %>
|
|
|
|
|
|
|
|
<%= f.money_field :amount,
|
|
|
|
label: t(".amount"),
|
|
|
|
auto_submit: true,
|
|
|
|
disable_currency: true %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2025-04-30 18:14:22 -04:00
|
|
|
<% dialog.with_section(title: t(".details")) do %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="pb-4">
|
2024-11-27 16:01:50 -05:00
|
|
|
<%= styled_form_with model: entry,
|
2025-04-14 11:40:34 -04:00
|
|
|
url: entry_path(entry),
|
2024-11-04 20:27:31 -05:00
|
|
|
class: "space-y-2",
|
|
|
|
data: { controller: "auto-submit-form" } do |f| %>
|
|
|
|
<%= f.text_area :notes,
|
|
|
|
label: t(".note_label"),
|
|
|
|
placeholder: t(".note_placeholder"),
|
|
|
|
rows: 5,
|
|
|
|
"data-auto-submit-form-target": "auto" %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
|
2025-04-30 18:14:22 -04:00
|
|
|
<% dialog.with_section(title: t(".settings")) do %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<div class="pb-4">
|
|
|
|
<!-- Delete Valuation Form -->
|
|
|
|
<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-04-14 11:40:34 -04:00
|
|
|
entry_path(entry),
|
2024-11-04 20:27:31 -05:00
|
|
|
method: :delete,
|
2025-02-13 11:31:07 -05:00
|
|
|
class: "rounded-lg px-3 py-2 text-red-500 text-sm font-medium border border-secondary",
|
2024-11-04 20:27:31 -05:00
|
|
|
data: { turbo_confirm: true, turbo_frame: "_top" } %>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2025-04-30 18:14:22 -04:00
|
|
|
<% end %>
|
2024-11-04 20:27:31 -05:00
|
|
|
<% end %>
|