{% macro preview(source_data) %}

Prévisualisation de {{ source_data.preview_rows_nb }} ligne{% if source_data.preview_rows_nb > 1 %}s{% endif %} sur {{ source_data.rows_nb }} au total :

{% for col in source_data.header %} {% endfor %} {% for row in source_data.preview_rows %} {% for val in row %} {% endfor %} {% endfor %}
{{ col }}
{{ val }}
{% endmacro %} {% macro body_errors(report, source_data, print_mode) %} {% if print_mode %} {{ body_errors_pdf(report, source_data) }} {% else %} {{ body_errors_screen(report, source_data) }} {% endif %} {% endmacro %} {% macro body_errors_pdf(report, source_data) %} {% for row in report.table.errors.body_by_rows %} {% if 'row' in row.errors %} {% else %} {% for d in source_data.data_rows[row.row_id - 2] %} {% if loop.index in row.errors %} {% endif %} {% endfor %} {% endif %} {% endfor %} {% endmacro %} {% macro body_errors_screen(report, source_data) %}
Ligne Colonne Valeur Erreur
{{ row.row_id }} {{ row.errors.row.title }}
{{ row.row_id }} {{ source_data.header[loop.index - 1] }} {{ d }}
{{row.errors[loop.index].title}}
{{ row.errors[loop.index].content | safe }}
{% for h in source_data.header %} {% endfor %} {% for row in report.table.errors.body_by_rows %} {% 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 %} {% for d in source_data.data_rows[row.row_id - 2] %} {% if loop.index in row.errors %} {% endfor %} {% endfor %}
1{{ h }}
{{ row.row_id }} {{ row.row_id }} {% elif 'row' in row.errors %} {% else %} {% endif %} {{ d }}
{% endmacro %} {% macro error_statistics(report) %} {% set structure_errors = report.table['error-stats']['structure-errors'] %} {% if structure_errors['count'] != 0 %}

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

{% else %}

Aucune erreur de structure.

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

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

{% endif %} {% endif %} {% endmacro %}