2024-08-09 11:22:57 -04:00
|
|
|
<%= 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" } } %>
|
2024-05-02 07:24:31 -06:00
|
|
|
|
2024-08-09 11:22:57 -04:00
|
|
|
<%= 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 %>
|
2024-05-02 07:24:31 -06:00
|
|
|
<% end %>
|