2024-02-02 09:05:04 -06:00
|
|
|
class PagesController < ApplicationController
|
2024-07-26 18:00:41 +02:00
|
|
|
layout :with_sidebar
|
2024-05-17 09:09:32 -04:00
|
|
|
|
2024-03-06 09:56:59 -05:00
|
|
|
include Filterable
|
2024-02-02 16:06:55 +00:00
|
|
|
|
2024-02-02 09:05:04 -06:00
|
|
|
def dashboard
|
2024-03-11 16:32:13 -04:00
|
|
|
snapshot = Current.family.snapshot(@period)
|
|
|
|
@net_worth_series = snapshot[:net_worth_series]
|
|
|
|
@asset_series = snapshot[:asset_series]
|
|
|
|
@liability_series = snapshot[:liability_series]
|
2024-04-24 13:34:50 +01:00
|
|
|
|
|
|
|
snapshot_transactions = Current.family.snapshot_transactions
|
|
|
|
@income_series = snapshot_transactions[:income_series]
|
|
|
|
@spending_series = snapshot_transactions[:spending_series]
|
2024-04-24 15:02:22 +01:00
|
|
|
@savings_rate_series = snapshot_transactions[:savings_rate_series]
|
2024-04-24 13:34:50 +01:00
|
|
|
|
|
|
|
snapshot_account_transactions = Current.family.snapshot_account_transactions
|
|
|
|
@top_spenders = snapshot_account_transactions[:top_spenders]
|
|
|
|
@top_earners = snapshot_account_transactions[:top_earners]
|
2024-04-24 15:02:22 +01:00
|
|
|
@top_savers = snapshot_account_transactions[:top_savers]
|
2024-04-24 13:34:50 +01:00
|
|
|
|
2024-05-03 12:11:31 +00:00
|
|
|
@accounts = Current.family.accounts
|
|
|
|
@account_groups = @accounts.by_group(period: @period, currency: Current.family.currency)
|
2024-07-01 10:49:43 -04:00
|
|
|
@transaction_entries = Current.family.entries.account_transactions.limit(6).reverse_chronological
|
2024-04-18 10:32:36 -04:00
|
|
|
|
|
|
|
# TODO: Placeholders for trendlines
|
|
|
|
placeholder_series_data = 10.times.map do |i|
|
|
|
|
{ date: Date.current - i.days, value: Money.new(0) }
|
|
|
|
end
|
|
|
|
@investing_series = TimeSeries.new(placeholder_series_data)
|
2024-02-02 09:05:04 -06:00
|
|
|
end
|
2024-04-18 07:56:51 -04:00
|
|
|
|
|
|
|
def changelog
|
2024-06-14 22:40:50 +02:00
|
|
|
@releases_notes = Provider::Github.new.fetch_latest_releases_notes
|
2024-04-18 07:56:51 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def feedback
|
|
|
|
end
|
|
|
|
|
|
|
|
def invites
|
|
|
|
end
|
2024-02-02 09:05:04 -06:00
|
|
|
end
|