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
8dd04ff4
Commit
8dd04ff4
authored
Nov 30, 2018
by
Pierre Dittgen
Browse files
Better PDF report
parent
88a48e53
Changes
3
Hide whitespace changes
Inline
Side-by-side
validata_ui/templates/base_template.html
View file @
8dd04ff4
...
...
@@ -71,7 +71,7 @@
<script
src=
"{{url_for('static', filename='js/popper.min.js')}}"
></script>
<script
src=
"{{url_for('static', filename='js/bootstrap.min.js')}}"
></script>
{% block footer %}{% endblock %}
<footer
class=
"footer"
>
<footer
class=
"footer
hidden-print
"
>
<div>
Le service de validation du
<a
href=
"https://www.validata.fr/"
>
projet Validata
</a>
est mis à disposition par
...
...
@@ -107,4 +107,4 @@
</body>
</html>
</html>
\ No newline at end of file
validata_ui/templates/validation_macros.html
View file @
8dd04ff4
...
...
@@ -24,7 +24,50 @@
</div>
{% endmacro %}
{% macro body_errors(report, source_data) %}
{% 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) %}
<table
id=
"table-errors"
class=
"table table-striped table-bordered table-sm"
>
<thead
class=
"thead-light"
>
<th>
Ligne
</th>
<th>
Colonne
</th>
<th>
Valeur
</th>
<th>
Erreur
</th>
</thead>
<tbody>
{% for row in report.table.errors.body_by_rows %}
{% if 'row' in row.errors %}
<tr>
<td>
{{ row.row_id }}
</td>
<td
colspan=
"3"
>
{{ row.errors.row.title }}
</td>
</tr>
{% else %}
{% for d in source_data.data_rows[row.row_id - 2] %}
{% if loop.index in row.errors %}
<tr>
<td>
{{ row.row_id }}
</td>
<td>
{{ source_data.header[loop.index - 1] }}
</td>
<td>
{{ d }}
</td>
<td>
<h5>
{{row.errors[loop.index].title}}
</h5>
{{ row.errors[loop.index].content | safe }}
</td>
</tr>
{% endif %}
{% endfor %}
{% endif %}
{% endfor %}
{% endmacro %}
{% 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"
>
...
...
@@ -109,4 +152,4 @@ au total
{% endif %}
{% endif %}
{% endmacro %}
\ No newline at end of file
{% endmacro %}
validata_ui/templates/validation_report.html
View file @
8dd04ff4
...
...
@@ -7,6 +7,10 @@
font-size
:
1.2em
;
font-weight
:
bold
;
}
#table-errors
td
h2
{
font-size
:
1em
;
font-weight
:
bold
;
}
@media
print
{
.hidden-print
{
...
...
@@ -161,7 +165,7 @@
{% else %}
{# display errors #}
{{ macros.body_errors(report, source_data) }}
{{ macros.body_errors(report, source_data
, print_mode
) }}
{% endif %}
...
...
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