<commit_before>{% extends "_layout.html" %}
{% set active_page = 'trial_balance' %}

{% import '_account_macros.html' as account_macros with context %}

{% block title %}Account {{ account_name }}{% endblock %}

{% block content %}
    {{ account_macros.account_name_header(account_name) }}

    {% if not interval %}

        {% include "charts/_chart_skeleton.html" %}

        {% with linechart_data = api.linechart_data(account_name) %}
            {% include "charts/_chart_account_balance.html" %}
        {% endwith %}

        {% with label="Monthly Changes", monthly_totals=api.interval_totals('month' ,account_name) %}
            {% include "charts/_chart_monthly_totals.html" %}
        {% endwith %}

        {% set treemap_data = api.treemap_data(account_name) %}
        {% with label=treemap_data.label, rows=treemap_data.balances, modifier=treemap_data.modifier, level=account_name|account_level-1 %}
            {% include "charts/_chart_treemap.html" %}
        {% endwith %}


    {% elif interval == 'month' %}
        {% set interval_format_str = "%b '%y" %}

        {% include "charts/_chart_skeleton.html" %}
        {% with label="Monthly Balances" if accumulate else "Monthly Changes", monthly_totals=api.interval_totals('month' ,account_name, accumulate) %}
            {% include "charts/_chart_monthly_totals.html" %}
        {% endwith %}
    {% elif interval == 'year' %}
        {% set interval_format_str = "%Y" %}

        {% include "charts/_chart_skeleton.html" %}
        {% with label="Yearly Balances" if accumulate else "Yearly Changes", yearly_totals=api.interval_totals('year', account_name, accumulate) %}
            {% include "charts/_chart_yearly_totals.html" %}
        {% endwith %}
    {% endif %}

        <div class="headerline">
            <h3>{% if interval %}<a href="{{ url_for('account_with_journal', name=account_name) }}">Journal</a>{% else %}Journal{% endif %}</h3>
            <h3>{% if not (interval == 'year' and accumulate) %}<a href="{{ url_for('account_with_interval_balances', name=account_name, interval='year') }}">Yearly Balances</a>{% else %}Yearly Balances{% endif %}</h3>
            <h3>{% if not (interval == 'month' and accumulate) %}<a href="{{ url_for('account_with_interval_balances', name=account_name, interval='month') }}">Monthly Balances</a>{% else %}Monthly Balances{% endif %}</h3>
            <h3>{% if not (interval == 'year' and not accumulate) %}<a href="{{ url_for('account_with_interval_changes', name=account_name, interval='year') }}">Yearly Changes</a>{% else %}Yearly Changes{% endif %}</h3>
            <h3>{% if not (interval == 'month' and not accumulate) %}<a href="{{ url_for('account_with_interval_changes', name=account_name, interval='month') }}">Monthly Changes</a>{% else %}Monthly Changes{% endif %}</h3>
        </div>

    {% if not interval %}
        {% set journal = api.journal(account_name, with_change_and_balance=True, with_journal_children=config.user.getboolean('journal-show-childentries')) %}
        {% with show_tablefilter=True, show_change_and_balance=True %}
            {% include "_journal_table.html" %}
        {% endwith %}
    {% endif %}

    {% if interval %}
        {% set interval_balances, dates = api.interval_balances(interval, account_name, accumulate) %}

        {% for begin_date, end_date in dates[-3:]|reverse %}
            {% with treemap_data = api.treemap_data(account_name, begin_date, end_date) %}
            {% with label=end_date.strftime(interval_format_str), rows=treemap_data.balances, modifier=treemap_data.modifier, level=account_name|account_level-1 %}
                {% include "charts/_chart_treemap.html" %}
            {% endwith %}
            {% endwith %}
        {% endfor %}
        <table class="fullwidth tree-table">
            <thead>
                <tr>
                    <th>Account <a href="" class="expand-all" title="Expand all accounts">Expand all</a></th>
                    {% for _, end_date in dates|reverse %}
                        <th>{{ end_date.strftime(interval_format_str) }}</th>
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
            {% for row in interval_balances %}
                {% with account_level = row[0].account|account_level  %}
                <tr data-level="{{ account_level }}" data-is-parent="{% if not row[0].is_leaf %}true{% else %}false{% endif %}">
                    <td class="account account-level-{{ account_level }}" data-level="{{ account_level }}">
                        <a href="{{ url_for('account_with_journal', name=row[0].account) }}" class="account">{{ row[0].account|last_segment }}</a>
                    </td>

                    {% for entry in row|reverse %}
                        <td class="num">
                            {% if entry.balances|length > 0 %}
                                <span class="balance">
                                {% for currency, number in entry.balances.items() %}
                                    {% if number %}
                                        {{ number|format_currency }} {{ currency }}<br>
                                    {% endif %}
                                {% endfor %}
                                </span>
                            {% endif %}
                            {% if entry.balances_children|length > 0 %}
                                <span class="tree-balance">
                                {% for currency, number in entry.balances_children.items() %}
                                    {% if number %}
                                        {{ number|format_currency }} {{ currency }}<br>
                                    {% endif %}
                                {% endfor %}<commit_msg>fix date column headers on account page<commit_after>{% extends "_layout.html" %}
{% set active_page = 'trial_balance' %}

{% import '_account_macros.html' as account_macros with context %}

{% block title %}Account {{ account_name }}{% endblock %}

{% block content %}
    {{ account_macros.account_name_header(account_name) }}

    {% if not interval %}

        {% include "charts/_chart_skeleton.html" %}

        {% with linechart_data = api.linechart_data(account_name) %}
            {% include "charts/_chart_account_balance.html" %}
        {% endwith %}

        {% with label="Monthly Changes", monthly_totals=api.interval_totals('month' ,account_name) %}
            {% include "charts/_chart_monthly_totals.html" %}
        {% endwith %}

        {% set treemap_data = api.treemap_data(account_name) %}
        {% with label=treemap_data.label, rows=treemap_data.balances, modifier=treemap_data.modifier, level=account_name|account_level-1 %}
            {% include "charts/_chart_treemap.html" %}
        {% endwith %}


    {% elif interval == 'month' %}
        {% set interval_format_str = "%b '%y" %}

        {% include "charts/_chart_skeleton.html" %}
        {% with label="Monthly Balances" if accumulate else "Monthly Changes", monthly_totals=api.interval_totals('month' ,account_name, accumulate) %}
            {% include "charts/_chart_monthly_totals.html" %}
        {% endwith %}
    {% elif interval == 'year' %}
        {% set interval_format_str = "%Y" %}

        {% include "charts/_chart_skeleton.html" %}
        {% with label="Yearly Balances" if accumulate else "Yearly Changes", yearly_totals=api.interval_totals('year', account_name, accumulate) %}
            {% include "charts/_chart_yearly_totals.html" %}
        {% endwith %}
    {% endif %}

        <div class="headerline">
            <h3>{% if interval %}<a href="{{ url_for('account_with_journal', name=account_name) }}">Journal</a>{% else %}Journal{% endif %}</h3>
            <h3>{% if not (interval == 'year' and accumulate) %}<a href="{{ url_for('account_with_interval_balances', name=account_name, interval='year') }}">Yearly Balances</a>{% else %}Yearly Balances{% endif %}</h3>
            <h3>{% if not (interval == 'month' and accumulate) %}<a href="{{ url_for('account_with_interval_balances', name=account_name, interval='month') }}">Monthly Balances</a>{% else %}Monthly Balances{% endif %}</h3>
            <h3>{% if not (interval == 'year' and not accumulate) %}<a href="{{ url_for('account_with_interval_changes', name=account_name, interval='year') }}">Yearly Changes</a>{% else %}Yearly Changes{% endif %}</h3>
            <h3>{% if not (interval == 'month' and not accumulate) %}<a href="{{ url_for('account_with_interval_changes', name=account_name, interval='month') }}">Monthly Changes</a>{% else %}Monthly Changes{% endif %}</h3>
        </div>

    {% if not interval %}
        {% set journal = api.journal(account_name, with_change_and_balance=True, with_journal_children=config.user.getboolean('journal-show-childentries')) %}
        {% with show_tablefilter=True, show_change_and_balance=True %}
            {% include "_journal_table.html" %}
        {% endwith %}
    {% endif %}

    {% if interval %}
        {% set interval_balances, dates = api.interval_balances(interval, account_name, accumulate) %}

        {% for begin_date, end_date in dates[-3:]|reverse %}
            {% with treemap_data = api.treemap_data(account_name, begin_date, end_date) %}
            {% with label=end_date.strftime(interval_format_str), rows=treemap_data.balances, modifier=treemap_data.modifier, level=account_name|account_level-1 %}
                {% include "charts/_chart_treemap.html" %}
            {% endwith %}
            {% endwith %}
        {% endfor %}
        <table class="fullwidth tree-table">
            <thead>
                <tr>
                    <th>Account <a href="" class="expand-all" title="Expand all accounts">Expand all</a></th>
                    {% for begin_date, _ in dates|reverse %}
                        <th>{{ begin_date.strftime(interval_format_str) }}</th>
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
            {% for row in interval_balances %}
                {% with account_level = row[0].account|account_level  %}
                <tr data-level="{{ account_level }}" data-is-parent="{% if not row[0].is_leaf %}true{% else %}false{% endif %}">
                    <td class="account account-level-{{ account_level }}" data-level="{{ account_level }}">
                        <a href="{{ url_for('account_with_journal', name=row[0].account) }}" class="account">{{ row[0].account|last_segment }}</a>
                    </td>

                    {% for entry in row|reverse %}
                        <td class="num">
                            {% if entry.balances|length > 0 %}
                                <span class="balance">
                                {% for currency, number in entry.balances.items() %}
                                    {% if number %}
                                        {{ number|format_currency }} {{ currency }}<br>
                                    {% endif %}
                                {% endfor %}
                                </span>
                            {% endif %}
                            {% if entry.balances_children|length > 0 %}
                                <span class="tree-balance">
                                {% for currency, number in entry.balances_children.items() %}
                                    {% if number %}
                                        {{ number|format_currency }} {{ currency }}<br>
                                    {% endif %}
                                {% endfor %}
{'fraction_non_alphanumeric': 0.14844827586206896, 'fraction_numerical': 0.0032758620689655174, 'mean_word_length': 2.1345582275060795, 'pattern_counts': {'":': 0, '<': 93, '<?xml version=': 0, '>': 97, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 24, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6930482', 'n_tokens_mistral': 3562, 'n_tokens_neox': 3113, 'n_words': 666}