Commit 45bf3bc9 authored by Pierre Dittgen's avatar Pierre Dittgen

Factorize report table header

parent 13c880cb
{% macro thead(report) %}
<thead class="thead-light">
<tr>
{% for h in report.table.headers %}
<th
scope="col"
{% if report.table.headers_alert[loop.index - 1] != "" %}class="{{ report.table.headers_alert[loop.index - 1] }}"{% endif %}
data-toggle="popover"
title="{{ report.table.headers_title[loop.index - 1]}}"
data-content="{{ report.table.headers_description[loop.index - 1] | commonmark2html | escape}}"
>{{ h }}</th>
{% endfor %}
</tr>
</thead>
{% endmacro %}
{% macro preview(report, source_data) %}
<p>
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 :
</p>
<div class="table-responsive">
<table class="table table-striped table-bordered table-sm table-hover">
<thead class="thead-light">
<tr>
{% for h in source_data.header %}
<th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1]}}" data-content="{{ report.table.headers_description[loop.index - 1] | commonmark2html | escape}}">{{
h }}</th>
{% endfor %}
</tr>
</thead>
{{ thead(report) }}
<tbody>
{% for row in source_data.preview_rows %}
<tr>
......@@ -71,13 +80,7 @@
{% macro body_errors_screen(report, source_data) %}
<div class="table-responsive-sm">
<table class="table-sm table-bordered table-striped table-hover">
<thead class="thead-light">
<th scope="col">1</th>
{% for h in source_data.header %}
<th scope="col" data-toggle="popover" title="{{ report.table.headers_title[loop.index - 1]}}" data-content="{{ report.table.headers_description[loop.index - 1] | commonmark2html | escape}}">{{
h }}</th>
{% endfor %}
</thead>
{{ thead(report) }}
<tbody>
{% for row in report.table.errors.body_by_rows %}
<tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment