mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-19 13:19:39 +02:00
Fix bulk edit dialog form structure
This commit is contained in:
parent
2e0794b8e1
commit
0fdeebceb1
3 changed files with 23 additions and 21 deletions
|
@ -2,13 +2,13 @@
|
||||||
<%= tag.dialog class: "w-full h-full bg-transparent theme-dark:backdrop:bg-alpha-black-900 backdrop:bg-overlay #{drawer? ? "lg:p-3" : "lg:p-1"}", **merged_opts do %>
|
<%= tag.dialog class: "w-full h-full bg-transparent theme-dark:backdrop:bg-alpha-black-900 backdrop:bg-overlay #{drawer? ? "lg:p-3" : "lg:p-1"}", **merged_opts do %>
|
||||||
<%= tag.div class: dialog_outer_classes do %>
|
<%= tag.div class: dialog_outer_classes do %>
|
||||||
<%= tag.div class: dialog_inner_classes, data: { dialog_target: "content" } do %>
|
<%= tag.div class: dialog_inner_classes, data: { dialog_target: "content" } do %>
|
||||||
<div class="grow overflow-y-auto py-4 space-y-4">
|
<div class="grow overflow-y-auto py-4 space-y-4 flex flex-col">
|
||||||
<% if header? %>
|
<% if header? %>
|
||||||
<%= header %>
|
<%= header %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% if body? %>
|
<% if body? %>
|
||||||
<div class="px-4">
|
<div class="px-4 grow">
|
||||||
<%= body %>
|
<%= body %>
|
||||||
|
|
||||||
<% if sections.any? %>
|
<% if sections.any? %>
|
||||||
|
|
|
@ -57,8 +57,6 @@ export default class extends Controller {
|
||||||
date_formatted: d.date_formatted,
|
date_formatted: d.date_formatted,
|
||||||
trend: d.trend,
|
trend: d.trend,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
console.log(this._normalDataPoints);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
_rememberInitialContainerSize() {
|
_rememberInitialContainerSize() {
|
||||||
|
|
|
@ -2,24 +2,28 @@
|
||||||
<% dialog.with_header(title: "Edit transactions", data: { bulk_select_target: "bulkEditDrawerHeader" }) %>
|
<% dialog.with_header(title: "Edit transactions", data: { bulk_select_target: "bulkEditDrawerHeader" }) %>
|
||||||
|
|
||||||
<% dialog.with_body do %>
|
<% dialog.with_body do %>
|
||||||
<%= styled_form_with url: transactions_bulk_update_path, scope: "bulk_update", class: "h-full", data: { turbo_frame: "_top" } do |form| %>
|
<%= styled_form_with url: transactions_bulk_update_path, scope: "bulk_update", class: "h-full flex flex-col justify-between gap-4", data: { turbo_frame: "_top" } do |form| %>
|
||||||
<% dialog.with_section(title: "Overview", open: true) do %>
|
<div class="space-y-4">
|
||||||
<div class="pb-6 space-y-2">
|
<%= render DisclosureComponent.new(title: "Overview", open: true) do %>
|
||||||
<%= form.date_field :date, label: "Date", max: Date.current %>
|
<div class="pb-6 space-y-2">
|
||||||
</div>
|
<%= form.date_field :date, label: "Date", max: Date.current %>
|
||||||
<% end %>
|
</div>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% dialog.with_section(title: "Transactions", open: true) do %>
|
<%= render DisclosureComponent.new(title: "Transactions", open: true) do %>
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
<%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %>
|
<%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: "Select a category", label: "Category", class: "text-subdued" } %>
|
||||||
<%= form.collection_select :merchant_id, Current.family.merchants.alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %>
|
<%= form.collection_select :merchant_id, Current.family.merchants.alphabetically, :id, :name, { prompt: "Select a merchant", label: "Merchant", class: "text-subdued" } %>
|
||||||
<%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", container_class: "h-40" } %>
|
<%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: "None", multiple: true, label: "Tags", container_class: "h-40" } %>
|
||||||
<%= form.text_area :notes, label: "Notes", placeholder: "Enter a note that will be applied to selected transactions", rows: 5 %>
|
<%= form.text_area :notes, label: "Notes", placeholder: "Enter a note that will be applied to selected transactions", rows: 5 %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex justify-end gap-2 mt-auto">
|
||||||
|
<%= render ButtonComponent.new(text: "Cancel", variant: "ghost", data: { action: "click->dialog#close" }) %>
|
||||||
|
<%= render ButtonComponent.new(text: "Save", data: { bulk_select_scope_param: "bulk_update", action: "bulk-select#submitBulkRequest" }) %>
|
||||||
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% dialog.with_action(cancel_action: true, text: "Cancel", variant: "ghost") %>
|
|
||||||
<% dialog.with_action(text: "Save", data: { bulk_select_scope_param: "bulk_update", action: "bulk-select#submitBulkRequest" }) %>
|
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue