Commit e5d0abd3 authored by Christophe Benz's avatar Christophe Benz

Display table out of container

parent 6be3cbdc
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
{% endwith %} {% endwith %}
<!-- main content --> <!-- main content -->
<div id="content" class="container"> <div id="content">
{% block content %}{% endblock %} {% block content %}{% endblock %}
</div> </div>
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
{% block title %}Accueil{% endblock %} {% block title %}Accueil{% endblock %}
{% block content %} {% block content %}
<div class="container">
{% for section in config.sections %} {% for section in config.sections %}
{% if section.catalog %} {% if section.catalog %}
<div class="mb-5"> <div class="mb-5">
...@@ -80,4 +80,5 @@ ...@@ -80,4 +80,5 @@
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div>
{% endblock %} {% endblock %}
...@@ -5,82 +5,84 @@ ...@@ -5,82 +5,84 @@
{% block title %}{{ section_title }} – {{ schema_info.title }}{% endblock %} {% block title %}{{ section_title }} – {{ schema_info.title }}{% endblock %}
{% block content %} {% block content %}
<div class="row my-4"> <div class="container">
<div class="col-lg-6 mb-4"> <div class="row my-4">
<div class="card"> <div class="col-lg-6 mb-4">
<div class="card-body"> <div class="card">
{{ schema_info_macros.html(schema_info, branches, tags, schema_current_version, doc_url) }} <div class="card-body">
{{ schema_info_macros.html(schema_info, branches, tags, schema_current_version, doc_url) }}
</div>
</div> </div>
</div> </div>
</div> <div class="col-lg-6">
<div class="col-lg-6"> <ul class="nav nav-tabs" id="myTab" role="tablist">
<ul class="nav nav-tabs" id="myTab" role="tablist"> <li class="nav-item">
<li class="nav-item"> <a class="nav-link active" id="file-tab" data-toggle="tab" href="#file" role="tab" aria-controls="file"
<a class="nav-link active" id="file-tab" data-toggle="tab" href="#file" role="tab" aria-controls="file" aria-selected="true">Fichier</a>
aria-selected="true">Fichier</a> </li>
</li> <li class="nav-item">
<li class="nav-item"> <a class="nav-link" id="url-tab" data-toggle="tab" href="#url" role="tab" aria-controls="url"
<a class="nav-link" id="url-tab" data-toggle="tab" href="#url" role="tab" aria-controls="url" aria-selected="false">URL</a>
aria-selected="false">URL</a> </li>
</li> {% if schema_info.resources %}
{% if schema_info.resources %} <li class="nav-item">
<li class="nav-item"> <a class="nav-link" id="examples-tab" data-toggle="tab" href="#example" role="tab"
<a class="nav-link" id="examples-tab" data-toggle="tab" href="#example" role="tab" aria-controls="examples" aria-selected="false">Exemples</a>
aria-controls="examples" aria-selected="false">Exemples</a> </li>
</li> {% endif %}
{% endif %} </ul>
</ul> {% set padding_class = 'p-3' %}
{% set padding_class = 'p-3' %} <div class="tab-content" id="myTabContent">
<div class="tab-content" id="myTabContent"> <div class="tab-pane show active {{ padding_class }}" id="file" role="tabpanel" aria-labelledby="file-tab">
<div class="tab-pane show active {{ padding_class }}" id="file" role="tabpanel" aria-labelledby="file-tab"> <form method="POST" enctype="multipart/form-data">
<form method="POST" enctype="multipart/form-data"> <input type="hidden" name="input" value="file" />
<input type="hidden" name="input" value="file" /> {% for key, value in schema_params.items() %}
{% for key, value in schema_params.items() %} <input type="hidden" name="{{ key }}" value="{{ value }}" />
<input type="hidden" name="{{ key }}" value="{{ value }}" /> {% endfor %}
{% endfor %} <div class="form-group">
<div class="form-group"> <input required type="file" class="form-control-file" name="file" id="file" accept=".csv, .xls, .xlsx, .ods" aria-describedby="fileHelpBlock" />
<input required type="file" class="form-control-file" name="file" id="file" accept=".csv, .xls, .xlsx, .ods" aria-describedby="fileHelpBlock" /> <small id="fileHelpBlock" class="form-text text-muted">
<small id="fileHelpBlock" class="form-text text-muted"> Exemple : .xlsx, .xls, .ods, .csv, .tsv, etc.
Exemple : .xlsx, .xls, .ods, .csv, .tsv, etc. </small>
</small> </div>
</div> <button type="submit" class="btn btn-primary">Valider le fichier</button>
<button type="submit" class="btn btn-primary">Valider le fichier</button> </form>
</form> </div>
</div> <div class="tab-pane {{ padding_class }}" id="url" role="tabpanel" aria-labelledby="url-tab">
<div class="tab-pane {{ padding_class }}" id="url" role="tabpanel" aria-labelledby="url-tab"> <form method="GET">
<form method="GET"> <input type="hidden" name="input" value="url" />
<input type="hidden" name="input" value="url" /> {% for key, value in schema_params.items() %}
{% for key, value in schema_params.items() %} <input type="hidden" name="{{ key }}" value="{{ value }}" />
<input type="hidden" name="{{ key }}" value="{{ value }}" /> {% endfor %}
{% endfor %} <div class="form-group">
<div class="form-group"> <input required name="url" type="url" class="form-control" id="url" aria-describedby="urlHelpBlock" placeholder="https://example.com/file.csv" />
<input required name="url" type="url" class="form-control" id="url" aria-describedby="urlHelpBlock" placeholder="https://example.com/file.csv" /> <small id="urlHelpBlock" class="form-text text-muted">
<small id="urlHelpBlock" class="form-text text-muted"> Exemple : .xlsx, .xls, .ods, .csv, .tsv, etc.
Exemple : .xlsx, .xls, .ods, .csv, .tsv, etc. </small>
</small> </div>
</div> <button type="submit" class="btn btn-primary">Valider le fichier</button>
<button type="submit" class="btn btn-primary">Valider le fichier</button> </form>
</form> </div>
</div> {% if schema_info.resources %}
{% if schema_info.resources %} <div class="tab-pane {{ padding_class }}" id="example" role="tabpanel" aria-labelledby="examples-tab">
<div class="tab-pane {{ padding_class }}" id="example" role="tabpanel" aria-labelledby="examples-tab"> <form method="GET">
<form method="GET"> <input name="input" value="example" type="hidden">
<input name="input" value="example" type="hidden"> {% for key, value in schema_params.items() %}
{% for key, value in schema_params.items() %} <input type="hidden" name="{{ key }}" value="{{ value }}" />
<input type="hidden" name="{{ key }}" value="{{ value }}" /> {% endfor %}
{% endfor %} <div class="form-group">
<div class="form-group"> <select required name="url" id="url" class="form-control">
<select required name="url" id="url" class="form-control"> <option selected disabled value="">Choisissez un fichier tabulaire d'exemple</option>
<option selected disabled value="">Choisissez un fichier tabulaire d'exemple</option> {% for res in schema_info.resources %}
{% for res in schema_info.resources %} <option value="{{ res.path }}">{{ res.title }}</option>
<option value="{{ res.path }}">{{ res.title }}</option> {% endfor %}
{% endfor %} </select>
</select> </div>
</div> <button type="submit" class="btn btn-primary">Valider le fichier</button>
<button type="submit" class="btn btn-primary">Valider le fichier</button> </form>
</form> </div>
{% endif %}
</div> </div>
{% endif %}
</div> </div>
</div> </div>
</div> </div>
......
...@@ -26,16 +26,17 @@ ...@@ -26,16 +26,17 @@
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<div class="container">
<p class="text-muted">Validation effectuée {{ validation_date }}</p> <p class="text-muted">Validation effectuée {{ validation_date }}</p>
{% if source.type == 'url' %} {% if source.type == 'url' %}
<p class="hidden-print"> <p class="hidden-print">
<a class="btn btn-outline-secondary" href="{{ pdf_report_url }}&url={{source.url|urlencode}}" target="_blank"> <a class="btn btn-outline-secondary" href="{{ pdf_report_url }}&url={{source.url|urlencode}}" target="_blank">
Télécharger en PDF Télécharger en PDF
</a> </a>
</p> </p>
{% endif %} {% endif %}
{# Schema info #} {# Schema info #}
<div class="row my-4"> <div class="row my-4">
...@@ -87,85 +88,69 @@ ...@@ -87,85 +88,69 @@
</div> </div>
</div> </div>
{% if report.error_count == 0 %} {% if report.error_count > 0 %}
{% if report.table.errors.structure %}
{{ macros.preview(source_data) }} <h3 class="my-4">Erreurs de structure</h3>
{# Non-column errors #}
{% else %} {% for err in report.table.errors.structure %}
{% if not err.in_column_comp %}
{% if report.table.errors.structure %} {{ err.content | safe }}
<h3 class="my-4">Erreurs de structure</h3> {% endif %}
{# Non-column errors #} {% endfor %}
{% for err in report.table.errors.structure %}
{% if not err.in_column_comp %} {# Column errors #}
{{ err.content | safe }} {% for err in report.table.errors.structure %}
{% endif %} {% if err.in_column_comp %}
{% endfor %} {{ err.content | safe }}
{% endif %}
{% endfor %}
{# Afficher un tableau de comparaison des colonnes #}
{% if report.table.column_comparison_needed %}
<table class="table table-bordered table-sm table-striped table-hover">
<thead class="thead-light">
<tr>
<th scope="col">Colonnes du fichier</th>
<th scope="col">Colonnes attendues</th>
</tr>
</thead>
<tbody>
{% for elt in report.table.column_comparison_info.table %}
<tr{% if elt[2] == 'ko' %} class="table-danger"{% endif %}>
<td>{{ elt[0] }}</td>
<td>{{ elt[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if report.table.column_comparison_info.has_missing %}
<p>Attention : toutes les colonnes attendues doivent être présentes dans le fichier à valider.<p>
{% endif %}
{% if report.table.column_comparison_info.has_case_errors %}
<p>Attention : la casse (minuscules/majuscules) doit être respectée dans les noms de colonne.<p>
{% endif %}
{# Column errors #}
{% for err in report.table.errors.structure %}
{% if err.in_column_comp %}
{{ err.content | safe }}
{% endif %} {% endif %}
{% endfor %}
{# Afficher un tableau de comparaison des colonnes #}
{% if report.table.column_comparison_needed %}
<table class="table table-bordered table-sm table-striped table-hover">
<thead class="thead-light">
<tr>
<th scope="col">Colonnes du fichier</th>
<th scope="col">Colonnes attendues</th>
</tr>
</thead>
<tbody>
{% for elt in report.table.column_comparison_info.table %}
<tr{% if elt[2] == 'ko' %} class="table-danger"{% endif %}>
<td>{{ elt[0] }}</td>
<td>{{ elt[1] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% if report.table.column_comparison_info.has_missing %}
<p>Attention : toutes les colonnes attendues doivent être présentes dans le fichier à valider.<p>
{% endif %}
{% if report.table.column_comparison_info.has_case_errors %}
<p>Attention : la casse (minuscules/majuscules) doit être respectée dans les noms de colonne.<p>
{% endif %}
{% endif %} {% endif %}
{% endif %} {% endif %}
</div>
{# We do display body errors! #}
{% if report.table.do_display_body_errors %} {% if report.table.do_display_body_errors %} {# We do display body errors! #}
<h3 class="my-4">Erreurs de contenu</h3> <div class="mx-4">
{% if report.table.errors.body %}
{# No errors - display preview #} <h3 class="my-4">Erreurs de contenu</h3>
{% if not report.table.errors.body %} {{ macros.body_errors(report, source_data, print_mode) }}
<p> {% else %}
Aucune erreur de contenu {{ macros.preview(source_data) }}
</p> {% endif %}
{{ macros.preview(source_data) }} </div>
{% else %} {# do not display errors #}
{% else %} <p>Veuillez corriger ces erreurs pour visualiser les éventuelles erreurs de contenu.</p>
{% endif %}
{# display errors #} {% endblock %}
{{ macros.body_errors(report, source_data, print_mode) }}
{% endif %}
{# do not display errors #}
{% else %}
<p>
Veuillez corriger ces erreurs pour visualiser les éventuelles erreurs de contenu.
</p>
{% endif %}
{% endif %}
{% endblock %}
{% block page_scripts %} {% block page_scripts %}
<script> <script>
......
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