validation_report.html 2.74 KB
Newer Older
1
{% extends "base_template.html" %}
2 3 4 5 6 7 8
{% 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
<div class="row">
Christophe Benz's avatar
Christophe Benz committed
11
    <div class="col-md-5 my-4">
Pierre Dittgen's avatar
Pierre Dittgen committed
12 13 14 15 16 17 18 19 20 21
        <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
{% if source_type == 'url' %}
Pierre Dittgen's avatar
Pierre Dittgen committed
42
<a class="btn btn-secondary my-2" href="{{ request.url }}">Relancer la validation</a>
43
{% 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_nb_errors > 0 %}
60 61

{% if not report.table.display_body_errors %}
Pierre Dittgen's avatar
Pierre Dittgen committed
62
<p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
63 64 65 66 67
    Veuillez corriger ce(s) erreur(s) pour visualiser les problèmes de contenu.
</p>

<p class="text">
    <a href="#" id="show_body_errors" title="">Affichez
Pierre Dittgen's avatar
Pierre Dittgen committed
68
        tout de même les problèmes de contenu</a>
Pierre Dittgen's avatar
Pierre Dittgen committed
69
</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
70 71 72 73 74
<div class="alert alert-warning">
    Attention, en cas de problèmes de structure signalés ci-dessus, certains messages d'erreurs ne seront pas
    pertinents
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
75 76 77
<div id="body_errors" style="display: none">
    {{ tables.body_errors(report, source_data) }}
</div>
78
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
79
<div>
Pierre Dittgen's avatar
Pierre Dittgen committed
80
    {{ tables.body_errors(report, source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
81
</div>
Pierre Dittgen's avatar
Pierre Dittgen committed
82 83 84
{% endif %}
{% endif %}

85

Pierre Dittgen's avatar
Pierre Dittgen committed
86
{% endif %}
87 88
{% endblock %}
{% block footer %}
89 90
<script>
    $(function () {
91
        // Errors tooltip activate
Pierre Dittgen's avatar
Pierre Dittgen committed
92 93 94
        $('[data-toggle="popover"]').popover({
            html: true,
            placement: 'auto',
95
            trigger: 'hover'
Pierre Dittgen's avatar
Pierre Dittgen committed
96
        });
97

Pierre Dittgen's avatar
Pierre Dittgen committed
98 99 100 101
        // Show body errors
        $('#show_body_errors').on('click', function () {
            $('#body_errors').show();
            $(this).remove();
102
        })
103 104
    })
</script>
105 106 107

{#
{{ report.table.errors.structure|length }} erreur(s) détectée(s)
108
{{ report.table.errors.body_nb_errors }} erreur(s) détectée(s)
109 110

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