diff --git a/app/views/goals/show.html.erb b/app/views/goals/show.html.erb index 95b353c2b..ecc343cad 100644 --- a/app/views/goals/show.html.erb +++ b/app/views/goals/show.html.erb @@ -204,21 +204,22 @@ <% end %> - <% elsif @goal.target_date.nil? %> - <%# No-target-date prompt %> + <% elsif @goal.goal_contributions.empty? %> + <%# No contributions yet: render an inline "add your first" CTA card + instead of a flat-at-$0 chart that looks broken. %>
- <%= icon("calendar-plus", size: "2xl") %> + <%= icon("piggy-bank", size: "2xl") %>
-

<%= t(".no_target_date.heading") %>

-

<%= t(".no_target_date.body") %>

+

<%= t(".empty.heading") %>

+

<%= t(".empty.body") %>

<%= render DS::Link.new( - text: t(".no_target_date.cta"), - variant: "outline", + text: t(".empty.cta"), + variant: "primary", size: "sm", - href: edit_goal_path(@goal), - icon: "calendar-plus", + href: new_goal_contribution_path(@goal), + icon: "plus", frame: :modal ) %>
@@ -236,10 +237,12 @@ <%= t(".projection.legend_saved") %> - - - <%= t(".projection.legend_projection") %> - + <% unless @goal.target_date.nil? %> + + + <%= t(".projection.legend_projection") %> + + <% end %>
" data-goal-projection-chart-aria-description-value="<%= strip_tags(@stats[:projection_summary]) %>">
+ <% if @goal.target_date.nil? %> +
+ <%= icon("calendar-plus", size: "sm") %> + <%= t(".no_target_date.body") %> + <%= link_to t(".no_target_date.cta"), + edit_goal_path(@goal), + data: { turbo_frame: :modal }, + class: "font-medium text-primary underline-offset-2 hover:underline" %> +
+ <% end %> <% end %> diff --git a/config/locales/views/goals/en.yml b/config/locales/views/goals/en.yml index 529d56d51..c40ecde16 100644 --- a/config/locales/views/goals/en.yml +++ b/config/locales/views/goals/en.yml @@ -153,6 +153,10 @@ en: heading: Add a target date body: Set a deadline to project a finish line and track required pace. cta: Set target date + empty: + heading: No contributions yet + body: Track your progress by adding your first contribution. + cta: Add a contribution source: initial: Initial manual: Manual