mirror of
https://github.com/we-promise/sure.git
synced 2026-09-05 14:51:15 +00:00
The transaction drawer already renders its category dropdown with the badge variant (colour + icon + search); the transfer drawer and the bulk-edit modal still show a bare alphabetical list. Bring those two into line for a more consistent category-picking experience.
29 lines
2.0 KiB
ERB
29 lines
2.0 KiB
ERB
<%= render DS::Dialog.new(variant: "drawer", frame: "bulk_transaction_edit_drawer") do |dialog| %>
|
|
<% dialog.with_header(title: t(".header_title"), data: { bulk_select_target: "bulkEditDrawerHeader" }) %>
|
|
|
|
<% dialog.with_body do %>
|
|
<%= 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| %>
|
|
<div class="space-y-4">
|
|
<%= render DS::Disclosure.new(title: t(".overview"), open: true) do %>
|
|
<%= form.date_field :date, label: t(".date_label"), max: Date.current %>
|
|
<% end %>
|
|
|
|
<%= render DS::Disclosure.new(title: t(".transactions_section"), open: true) do %>
|
|
<div class="space-y-2">
|
|
<%= form.text_field :name, label: t(".name_label"), placeholder: t(".name_placeholder") %>
|
|
<%= form.collection_select :category_id, Current.family.categories.alphabetically, :id, :name, { prompt: t(".category_prompt"), label: t(".category_label"), class: "text-subdued", variant: :badge, searchable: true } %>
|
|
<%= form.collection_select :merchant_id, Current.family.available_merchants_for(Current.user).alphabetically, :id, :name, { prompt: t(".merchant_prompt"), label: t(".merchant_label"), class: "text-subdued" } %>
|
|
<%= form.select :tag_ids, Current.family.tags.alphabetically.pluck(:name, :id), { include_blank: t(".none"), multiple: true, label: t(".tags_label"), include_hidden: false } %>
|
|
<%= form.text_area :notes, label: t(".notes_label"), placeholder: t(".notes_placeholder"), rows: 5 %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="flex justify-end gap-2 mt-auto">
|
|
<%= render DS::Button.new(text: t(".cancel"), variant: "ghost", data: { action: "click->DS--dialog#close" }) %>
|
|
<%= render DS::Button.new(text: t(".save"), type: :submit, data: { bulk_select_scope_param: "bulk_update", action: "bulk-select#submitBulkRequest" }) %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|