mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-07-24 07:39:39 +02:00
* Consolidate modal form structure into partial + helper * Scaffold out trade transaction form * Normalize translations * Add buy and sell trade form with tests * Move entryable lists to dedicated controllers * Delegate entry group contents rendering * More cleanup * Extract transaction and valuation update logic from entries controller * Delegate edit and show actions to entryables * Trade builder * Update paths for transaction updates
21 lines
1.5 KiB
Text
21 lines
1.5 KiB
Text
<%= modal_form_wrapper title: t(".delete_category"), subtitle: t(".explanation", category_name: @category.name) do %>
|
|
<%= styled_form_with url: category_deletions_path(@category),
|
|
class: "space-y-4",
|
|
data: {
|
|
turbo: false,
|
|
controller: "deletion",
|
|
deletion_dangerous_action_class: "form-field__submit bg-white text-red-600 border hover:bg-red-50",
|
|
deletion_safe_action_class: "form-field__submit border border-transparent",
|
|
deletion_submit_text_when_not_replacing_value: t(".delete_and_leave_uncategorized", category_name: @category.name),
|
|
deletion_submit_text_when_replacing_value: t(".delete_and_recategorize", category_name: @category.name) } do |f| %>
|
|
<%= f.collection_select :replacement_category_id,
|
|
Current.family.categories.alphabetically.without(@category),
|
|
:id, :name,
|
|
{ prompt: t(".replacement_category_prompt"), label: t(".category") },
|
|
{ data: { deletion_target: "replacementField", action: "deletion#updateSubmitButton" } } %>
|
|
|
|
<%= f.submit t(".delete_and_leave_uncategorized", category_name: @category.name),
|
|
class: "form-field__submit bg-white text-red-600 border hover:bg-red-50",
|
|
data: { deletion_target: "submitButton" } %>
|
|
<% end %>
|
|
<% end %>
|