Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Validata
Validata UI
Commits
45bf3bc9
Commit
45bf3bc9
authored
Jul 24, 2019
by
Pierre Dittgen
Browse files
Factorize report table header
parent
13c880cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
validata_ui/templates/validation_macros.html
View file @
45bf3bc9
{% 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>
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment