mirror of
https://github.com/we-promise/sure.git
synced 2026-06-01 08:49:01 +00:00
feat(savings_goals/index): collapsed Archived section + archived-aware card
- Controller: @archived_goals exposes state=archived rows already pulled by the all_goals load. No extra query (sliced from the existing array). - Index template: <details> disclosure under "Completed" so archived goals are reachable from the list without cluttering the active / completed sections. Collapsed by default. - GoalCardComponent: uses display_status for the data attribute (so the card on the index reads as Archived instead of Behind), opacity-75 applies to archived too, footer_line short-circuits to "Archived" and pace_line returns nil. Matches the show-page archived semantics shipped earlier. - Locale: new savings_goals.index.archived_section.heading and savings_goals.goal_card.footer_archived.
This commit is contained in:
@@ -13,6 +13,7 @@ class SavingsGoalsController < ApplicationController
|
||||
@active_goals = all_goals.reject { |g| %w[completed archived].include?(g.state) }
|
||||
.sort_by { |g| [ g.paused? ? 3 : ACTIVE_STATUS_RANK.fetch(g.status, 4), g.name.downcase ] }
|
||||
@completed_goals = all_goals.select { |g| g.state == "completed" }
|
||||
@archived_goals = all_goals.select { |g| g.state == "archived" }
|
||||
|
||||
@linkable_account_count = Current.family.accounts.where(accountable_type: "Depository").visible.count
|
||||
@kpi = kpi_payload(@active_goals)
|
||||
|
||||
Reference in New Issue
Block a user