{% extends "base.html" %} {% block title %}{{ _("Goals") }} · Wealth Dashboard{% endblock %} {% block heading %}{{ _("Savings goals") }}{% endblock %} {% block lede %}

{{ _("An amount by a date, and how it is going. A goal is fed by an account — the holiday account, whose balance is the progress — or by hand, an amount at a time, for a goal that lives inside a bigger account.") }}

{% endblock %} {% block content %} {% macro goal_fields(g) %}
{% endmacro %} {% set kind_labels = {'saving': _("Something I am saving for"), 'house': _("A home"), 'car': _("A car"), 'education': _("Education"), 'wedding': _("A wedding"), 'emergency': _("An emergency fund"), 'travel': _("A trip")} %} {% set kind_hints = {'saving': _("An amount by a date, for whatever it is."), 'house': _("A deposit for a place of your own."), 'car': _("The next car, paid for rather than financed."), 'education': _("Fees, books and courses."), 'wedding': _("The day itself."), 'emergency': _("Three to six months of spending, untouched."), 'travel': _("The one you keep putting off.")} %}
{% for k in kinds %} {{ kind_labels[k] }}{{ kind_hints[k] }} {% endfor %} {{ _("Retirement") }}{{ _("Life after work — and whether it lasts. A plan of its own.") }}

{{ _("Add a goal") }}

{{ kind_labels[kind] }}
{{ goal_fields(none) }}
{% for g in goals %}

{{ g.name }} {{ kind_labels[g.kind] if g.kind in kind_labels else g.kind }}

{% if g.fed_by == 'account' %}{{ _f("fed by {account}", account=g.account_name) }}{% else %}{{ _("fed by hand") }}{% endif %}{% if g.target_date %} · {{ _f("by {date}", date=d(g.target_date)) }}{% endif %}
{{ money(g.progress, g.currency) }} / {{ money(g.target, g.currency) }}

{{ '%.0f' | format(g.pct) }} % · {% if g.done %}{{ _("reached") }} {% elif g.monthly_needed is not none %}{{ _f("{amount} a month for {n} months reaches it", amount=money(g.monthly_needed, g.currency), n=g.months_left) }}{% if plan_monthly and g.monthly_needed > plan_monthly %} — {{ _f("more than the {plan} a month of your plan", plan=money(plan_monthly, base_currency)) }}{% endif %} {% elif g.overdue %}{{ _("the date has passed") }} {% else %}{{ _f("{amount} to go", amount=money(g.remaining, g.currency)) }}{% endif %}

{% if g.fed_by == 'hand' %}
{% endif %}
{{ _("Change the goal") }}
{{ goal_fields(g) }}
{% else %}

{{ _("No goals yet.") }}

{% endfor %} {% endblock %}