validation_report.html 3.36 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
        <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>
Pierre Dittgen's avatar
Pierre Dittgen committed
19
                {% if val_info.author or val_info.contributor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
20
                <p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
                    {% if val_info.author %}
                    Auteur : {{ val_info.author }}
                    {% endif %}
                    {% if val_info.contributor %}
                    <br />Contributeur(s) : {{ val_info.contributor }}
                    {% endif %}
                </p>
                {% endif %}
                <p>
                    <a href="{{ val_info.docurl }}" target="_blank" class="card-link">Documentation</a>
                </p>
                <hr />
                <p class="text alert alert-info" style="margin-bottom: 0;">
                    <em>Source
                        ({% if source_type == 'file' %}fichier{% endif %}{% if source_type == 'url' %}URL{% endif %})
                        : {{ source.name }}</em>
Pierre Dittgen's avatar
Pierre Dittgen committed
37 38 39
                </p>
            </div>
        </div>
40 41 42
    </div>
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
43
{% import 'table_macros.html' as tables %}
Pierre Dittgen's avatar
Pierre Dittgen committed
44

45
{% if report.error_count == 0 %}
46 47
<h2>La table est valide</h2>
<p>Aucune erreur détectée</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
48

Pierre Dittgen's avatar
Pierre Dittgen committed
49
{{ tables.preview(source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
50

51
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
52

53
<h2>La table est invalide</h2>
Pierre Dittgen's avatar
Pierre Dittgen committed
54

55
{% if source_type == 'url' %}
Pierre Dittgen's avatar
Pierre Dittgen committed
56
<a class="btn btn-secondary my-2" href="{{ request.url }}">Relancer la validation</a>
57
{% endif %}
Pierre Dittgen's avatar
Pierre Dittgen committed
58
{# table checks #}
Pierre Dittgen's avatar
Pierre Dittgen committed
59

60
{% if report.table.errors.structure %}
Pierre Dittgen's avatar
Pierre Dittgen committed
61
<div>
62
    <h3>Problèmes de structure</h3>
63 64 65 66 67
    {% for err in report.table.errors.structure %}
    <div class="alert alert-danger">
        {{ err.message | safe}}
    </div>
    {% endfor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
68
</div>
69
{% endif %}
70

Pierre Dittgen's avatar
Pierre Dittgen committed
71
<!-- row checks -->
72 73

{% if report.table.errors.body %}
74 75

{% if not report.table.display_body_errors %}
Pierre Dittgen's avatar
Pierre Dittgen committed
76
<p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
77 78 79 80 81
    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
82
        tout de même les problèmes de contenu</a>
Pierre Dittgen's avatar
Pierre Dittgen committed
83
</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
84 85 86 87 88
<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
89 90 91
<div id="body_errors" style="display: none">
    {{ tables.body_errors(report, source_data) }}
</div>
92
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
93
<div>
Pierre Dittgen's avatar
Pierre Dittgen committed
94
    {{ tables.body_errors(report, source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
95
</div>
Pierre Dittgen's avatar
Pierre Dittgen committed
96 97 98
{% endif %}
{% endif %}

99

Pierre Dittgen's avatar
Pierre Dittgen committed
100
{% endif %}
101 102
{% endblock %}
{% block footer %}
103 104
<script>
    $(function () {
105
        // Errors tooltip activate
Pierre Dittgen's avatar
Pierre Dittgen committed
106 107 108
        $('[data-toggle="popover"]').popover({
            html: true,
            placement: 'auto',
109
            trigger: 'hover'
Pierre Dittgen's avatar
Pierre Dittgen committed
110
        });
111

Pierre Dittgen's avatar
Pierre Dittgen committed
112 113 114 115
        // Show body errors
        $('#show_body_errors').on('click', function () {
            $('#body_errors').show();
            $(this).remove();
116
        })
117 118
    })
</script>
119 120 121 122 123 124

{#
{{ 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
125
{% endblock %}