{% set infotext = { 'green': "The latest posting is a balance check that passed (i.e., known-good)", 'red': "The latest posting is a balance check that failed (i.e., known-bad)", 'yellow': "The latest posting is not a balance check (i.e., unknown)", 'gray': "The account hasn't been updated in a while (as compared to the last available date in the file)", } %} {% macro indicator(account_name) %} {% if account_name and uptodate_eligible(account_name) %} {% set status=api.is_account_uptodate(account_name, look_back_days=config.user.getint('uptodate-indicator-grey-lookback-days')) %} {% if status %} {% endif %} {% endif %} {% endmacro %} {% macro last_account_activity(account_name) %} {% if account_name and uptodate_eligible(account_name) %} {% set last_account_activity_in_days=api.last_account_activity_in_days(account_name) %} {% if last_account_activity_in_days > config.user.getint('uptodate-indicator-grey-lookback-days') %} {% endif %} {% endif %} {% endmacro %} {% macro account_name(account_name, last_segment=False) %} {{ account_name|last_segment if last_segment else account_name }} {% if config.user.getboolean('uptodate-indicator-show-everywhere') %} {{ last_account_activity(account_name) }} {{ indicator(account_name) }} {% endif %} {% endmacro %} {% macro account_name_header(account_name) %}

{% set levels = account_name|account_level %} {% for level in range(0, levels) %} {% set subaccount_name = account_name.rsplit(':', maxsplit=levels-loop.index)[0] %} {% set subaccount_part = account_name.split(':')[level] %} {%- if loop.last -%} {{ subaccount_part }} {%- else -%} {{ subaccount_part }}: {%- endif -%} {% endfor %} {{ indicator(account_name) }} {{ last_account_activity(account_name) }} {% set activity = api.statistics(account_name=account_name) %} {% if activity %}
(Last entry: {{ activity.last_posting_date }})
{% endif %}

{% endmacro %}