Files
sure/app/views/transactions/categorizes/_entry_row.html.erb
Claude b39a08be6a Add parent/child category hierarchy to all category selects; add search to account select
Category selection consistency:
- DS::Select (shared component powering the main transaction form,
  transaction edit, bulk-update, and transfer category pickers) now
  indents subcategories with a corner-down-right icon, matching the
  existing transaction-row category dropdown.
- Feed DS::Select-based category pickers with Category.alphabetically_by_hierarchy
  (parent name, then parent-before-children, then own name) so children
  render directly under their parent.
- Added Category::Group.select_options, a shared helper producing
  parent-then-child ordered options (with an indent marker) for plain
  HTML <select> elements. Used by:
  - Rule builder category condition/action selects
  - Bulk 'categorize transactions' select
  - CSV/QIF import category mapping select
- Grouped the splits category combobox and the transaction search
  category filter checklist the same way, both with the
  corner-down-right indent icon used elsewhere.

Account selection:
- Added searchable: true to the account select in the new/edit
  transaction form, matching the category and merchant selects next
  to it.
2026-07-28 16:44:20 +00:00

21 lines
1.4 KiB
Plaintext

<%= turbo_frame_tag "categorize_entry_#{entry.id}" do %>
<input type="hidden" name="all_entry_ids[]" value="<%= entry.id %>">
<div class="grid grid-cols-[1rem_1fr_5rem_6rem_6.5rem] gap-3 items-center px-5 py-3 bg-container hover:bg-container-hover">
<input type="checkbox" name="entry_ids[]" value="<%= entry.id %>"
checked class="checkbox checkbox--light shrink-0"
aria-label="<%= t("transactions.categorizes.entry_row.include_checkbox", name: entry.name) %>"
data-action="change->categorize#uncheckRule">
<span class="min-w-0 font-medium text-primary truncate"><%= entry.name %></span>
<span class="text-secondary whitespace-nowrap"><%= format_date(entry.date) %></span>
<span class="privacy-sensitive font-medium text-right whitespace-nowrap <%= entry.amount.negative? ? "text-green-600" : "text-primary" %>">
<%= format_money(entry.amount_money.abs) %>
</span>
<%= select_tag "category_id",
options_for_select(Category::Group.select_options(categories)),
prompt: t("transactions.categorizes.show.assign_category_prompt"),
aria: { label: t("transactions.categorizes.entry_row.assign_category_select", name: entry.name) },
class: "w-full text-xs border border-primary rounded-lg px-1.5 py-0.5 bg-container text-secondary",
data: { entry_id: entry.id, action: "change->categorize#assignEntry" } %>
</div>
<% end %>