{% macro thead(report, with_lineno_col=False) %} {% if with_lineno_col %} 1 {% endif %} {% for h in report.table.header %} {{ h }} {% endfor %} {% endmacro %} {% macro preview(report, source_data) %}
{{ thead(report) }} {% for row in source_data.preview_rows %} {% for val in row %} {% endfor %} {% endfor %}
{{ val }}
{% endmacro %} {% macro body_errors(report, source_data, print_mode) %} {{ body_errors_screen(report, source_data) }} {% endmacro %} {% macro body_errors_screen(report, source_data) %}
{{ thead(report, True) }} {% for row in report.table.errors.body_by_rows %} {# Line no #} {% if 'row' in row.errors %} {% if row.errors.row.code == 'blank-row' and not source_data.data_rows[row.row_id -2] %} {% for _ in report.table.headers %} {% endfor %} {% endif %} {% else %} {% endif %} {# normal columns #} {% for d in source_data.data_rows[row.row_id - 2] %} {% if loop.index in row.errors %} {% elif 'row' in row.errors %} {% else %} {% endif %} {%- endfor %} {% endfor %}
{{ row.row_id }} {{ row.row_id }}{{ d }}{{ d }}{{ d }}
{% endmacro %} {% macro error_statistics(report) %} {% set structure_errors = report.table['error-stats']['structure-errors'] %} {% if structure_errors['count'] != 0 %}

{{ _('Erreurs de structure') }} ({{ structure_errors['count'] }}) :

{% else %}

{{ _('Aucune erreur de structure') }}.

{% endif %} {% set value_errors = report.table['error-stats']['body-errors'] %} {% if value_errors['count'] > 0 %}

Erreurs de contenu ({{ value_errors['count'] }} sur {{ value_errors['rows-count'] }} ligne{% if value_errors['rows-count'] > 1 %}s{% endif %}) :

{% else %}

{{ _('Aucune erreur de contenu') }}

{% endif %} {% endmacro %}