"
data-goal-stepper-summary-no-date-value="<%= t("goals.form_stepper.step2.review.summary_no_date") %>"
data-goal-stepper-account-count-one-value="<%= t("goals.form_stepper.step2.review.account_count.one") %>"
data-goal-stepper-account-count-other-value="<%= t("goals.form_stepper.step2.review.account_count.other") %>"
data-goal-stepper-suggested-with-date-value="<%= t("goals.form_stepper.step2.review.suggested_with_date") %>"
data-goal-stepper-suggested-no-date-value="<%= t("goals.form_stepper.step2.review.suggested_no_date") %>">
<% if goal.errors[:base].any? %>
<%= render "shared/form_errors", model: goal %>
<% end %>
<%# Connected stepper %>
1
<%= t("goals.form_stepper.step1.label") %>
2
<%= t("goals.form_stepper.step2.label") %>
<%= styled_form_with model: goal, url: goals_path, class: "space-y-4", data: { action: "keydown.enter->goal-stepper#blockEnter" } do |f| %>
<%= t("goals.form_stepper.step1.heading") %>
<%= t("goals.form_stepper.step1.subheading") %>
<%= render "color_picker", form: f, colors: Goal::COLORS, icons: Goal::ICONS %>
<%= f.text_field :name,
placeholder: t("goals.form_stepper.step1.fields.name_placeholder"),
autofocus: true,
label: t("goals.form_stepper.step1.fields.name"),
data: { goal_stepper_target: "nameInput", action: "input->goal-stepper#nameChanged" } %>
<%= t("goals.form_stepper.errors.name_required") %>
<%= f.money_field :target_amount,
label: t("goals.form_stepper.step1.fields.target_amount"),
hide_currency: true,
amount_data: { goal_stepper_target: "amountInput", action: "input->goal-stepper#amountChanged" } %>
<%= t("goals.form_stepper.errors.amount_required") %>
<%= f.date_field :target_date,
label: t("goals.form_stepper.step1.fields.target_date") %>
<%= t("goals.form_stepper.step1.fields.funding_accounts") %>
<%= t("goals.form_stepper.step1.fields.funding_accounts_hint") %>
<% grouped = linkable_accounts.group_by { |a| a.subtype.to_s.presence || "other" } %>
<% grouped.each_with_index do |(subtype, accts), group_idx| %>
<%= t("goals.form_stepper.step1.subtypes.#{subtype}", default: subtype.titleize) %>
">
<% accts.each_with_index do |account, idx| %>
<% end %>
<% end %>
<%= t("goals.form_stepper.errors.accounts_required") %>
<%= render DS::Disclosure.new(title: t("goals.form_stepper.step1.fields.notes_summary"), align: "right") do %>
<%= f.text_area :notes,
label: t("goals.form_stepper.step1.fields.notes"),
rows: 3,
placeholder: t("goals.form_stepper.step1.fields.notes_placeholder") %>
<% end %>
<%= t("goals.form_stepper.step2.heading") %>
<%= t("goals.form_stepper.step2.subheading") %>
<%= render DS::FilledIcon.new(variant: :container, icon: "target", size: "lg", rounded: false) %>
—
<%= render DS::FilledIcon.new(variant: :container, icon: "zap", size: "md", rounded: false) %>
<%= t("goals.form_stepper.step2.add_initial_contribution") %>
<%= t("goals.form_stepper.step2.add_initial_contribution_sub") %>
<%= icon("chevron-down", size: "sm") %>
<%= f.money_field :initial_contribution_amount,
label: t("goals.form_stepper.step2.initial_amount"),
hide_currency: true,
amount_data: { goal_stepper_target: "initialContributionAmount" } %>
<%= render DS::Button.new(
variant: "ghost",
text: t("goals.form_stepper.back"),
icon: "arrow-left",
icon_position: :left,
data: {
action: "click->goal-stepper#footerLeft"
}
) %>
<%= render DS::Button.new(
text: t("goals.form_stepper.continue"),
variant: "primary",
icon: "arrow-right",
icon_position: :right,
data: {
goal_stepper_target: "footerRightButton",
action: "click->goal-stepper#footerRight"
}
) %>
<% end %>