{% load string_formating %}

<div class="row mb-1 font-monospace">
    <div class="col">
        <div class="fw-bold">
            {{ report.title }}
        </div>
    </div>
</div>

<div class="row mx-0 mb-3 text-muted fw-normal fs--2 border font-monospace">
    {% if report.description %}
        <div class="col-auto ps-1 pe-3">
            Description: {{ report.description }}
        </div>
    {% endif %}
        <div class="col-auto ps-1 pe-3">
        Printed On: {% now "D, M j, Y" %} at {% now "g:i A" %}
    </div>
        <div class="col-auto ps-1 pe-3">
        Financially Accurate: {% if report.is_financially_accurate %}True{% else %}False{% endif %}
    </div>
    {% for argument, value in report_run_arguments_values.items %}
        <div class="col-auto ps-1 pe-3">
            {{ argument|underscores_to_spaces|title }}: {{ value }}
        </div>
    {% endfor %}
</div>

<div class="row">
    <div class="col fs--2">

        <table class="table table-sm table-hover table-print">
            <thead>
            {% for column in report.columns %}
                <th class="align-text-top {{ column.css_class }}">
                    {{ column.title }}
                    {% if column.sub_title %}
                        <span class="text-muted fw-normal fs--2">
                            <br>{{ column.sub_title }}
                        </span>
                    {% endif %}
                </th>
            {% endfor %}
            </thead>
            <tbody>
            {% for row in report.rows %}
                <tr class="{% if row.bold %}fw-bold{% endif %}"
                    {% if row.page_break %}style="page-break-before: always;"{% endif %}>
                    {% if row.span_all_columns %}
                        <td colspan="{{ report.column_count }}">
                            {% for cell in row.cells %}
                                {{ cell.value|safe }}
                            {% endfor %}
                        </td>
                    {% else %}
                        {% for cell in row.cells %}
                            <td class="{{ cell.css_class }}">
                                {{ cell.value_verbose }}
                                {% if cell.sub_value %}
                                    <br>
                                    {{ cell.sub_value_verbose }}
                                {% endif %}
                            </td>
                        {% endfor %}
                    {% endif %}
                </tr>
            {% endfor %}
            </tbody>
        </table>

    </div>
</div>