validation_report.html 2.52 KB
Newer Older
1
2
3
4
5
6
7
8
{% extends "base.html" %}
{% block title %}{{ title }}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<h1>{{ title }}</h1>

Pierre Dittgen's avatar
Pierre Dittgen committed
9
{# Schema info #}
Pierre Dittgen's avatar
Pierre Dittgen committed
10
11
12
13
14
15
16
17
18
19
20
21
<div class="row">
    <div class="col-md-5">
        <div class="card bg-faded">
            <div class="card-body">
                <h5 class="card-title">
                    Schéma {{ val_info.code }}
                    <span class="badge badge-primary">{{ val_info.version }}</span>
                </h5>
                <h6 class="card-subtitle mb-2 text-muted">{{ val_info.description }}</h6>
                <p class="text">
                    {% if source_type == 'file' %}Fichier{% endif %}
                    {% if source_type == 'url' %}URL{% endif %}
22
                    à valider : {{ source.name }}
Pierre Dittgen's avatar
Pierre Dittgen committed
23
24
25
                </p>
            </div>
        </div>
26
27
28
    </div>
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
29
{% import 'table_macros.html' as tables %}
Pierre Dittgen's avatar
Pierre Dittgen committed
30

31
{% if report.error_count == 0 %}
32
33
<h2>La table est valide</h2>
<p>Aucune erreur détectée</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
34

Pierre Dittgen's avatar
Pierre Dittgen committed
35
{{ tables.preview(source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
36

37
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
38

39
<h2>La table est invalide</h2>
Pierre Dittgen's avatar
Pierre Dittgen committed
40

41
42
43
{% if source_type == 'url' %}
<button class="btn btn-primary" id="btn-reload">Relancer la validation</button>
{% endif %}
Pierre Dittgen's avatar
Pierre Dittgen committed
44
{# table checks #}
Pierre Dittgen's avatar
Pierre Dittgen committed
45

46
{% if report.table.errors.structure %}
Pierre Dittgen's avatar
Pierre Dittgen committed
47
<div>
48
    <h3>Problèmes de structure</h3>
49
50
51
52
53
    {% for err in report.table.errors.structure %}
    <div class="alert alert-danger">
        {{ err.message | safe}}
    </div>
    {% endfor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
54
</div>
55
{% endif %}
56

Pierre Dittgen's avatar
Pierre Dittgen committed
57
<!-- row checks -->
58
59

{% if report.table.errors.body %}
60
61

{% if not report.table.display_body_errors %}
Pierre Dittgen's avatar
Pierre Dittgen committed
62
63
64
65
66
67
68
69
<p class="text">
    Veuillez corriger ce(s) erreur(s) pour visualiser les problèmes de contenu.<br />
    <a href="#" id="show_body_errors" title="Attention, en cas de problème sur les colonnes, certains messages d'errur ne seront pas pertinents">Affichez
        tout de même les erreurs de valeur</a>
</p>
<div id="body_errors" style="display: none">
    {{ tables.body_errors(report, source_data) }}
</div>
70
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
71
<div>
Pierre Dittgen's avatar
Pierre Dittgen committed
72
    {{ tables.body_errors(report, source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
73
</div>
Pierre Dittgen's avatar
Pierre Dittgen committed
74
75
76
{% endif %}
{% endif %}

77

Pierre Dittgen's avatar
Pierre Dittgen committed
78
{% endif %}
79
80
{% endblock %}
{% block footer %}
81
82
<script>
    $(function () {
83
        // Errors tooltip activate
Pierre Dittgen's avatar
Pierre Dittgen committed
84
        $('[data-toggle="tooltip"]').tooltip();
85

Pierre Dittgen's avatar
Pierre Dittgen committed
86
87
88
89
        // Show body errors
        $('#show_body_errors').on('click', function () {
            $('#body_errors').show();
            $(this).remove();
90
        })
91
92
    })
</script>
93
94
95
96
97
98

{#
{{ report.table.errors.structure|length }} erreur(s) détectée(s)
{{ report.table.errors.body|length }} erreur(s) détectée(s)

#}
Pierre Dittgen's avatar
Pierre Dittgen committed
99
{% endblock %}