validation_report.html 3.59 KB
Newer Older
1
{% extends "base_template.html" %}
2 3 4 5 6 7
{% block title %}{{ title }}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
8
<p class="text">Validation effectuée {{ validation_date }}</p>
9

Pierre Dittgen's avatar
Pierre Dittgen committed
10
{# Schema info #}
Pierre Dittgen's avatar
Pierre Dittgen committed
11
<div class="row">
Christophe Benz's avatar
Christophe Benz committed
12
    <div class="col-md-5 my-4">
Pierre Dittgen's avatar
Pierre Dittgen committed
13 14 15 16 17 18 19
        <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
20
                {% if val_info.author or val_info.contributor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
21
                <p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
                    {% 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
38 39 40
                </p>
            </div>
        </div>
41 42 43
    </div>
</div>

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

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

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

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

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

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

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

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

74 75 76 77 78 79 80 81 82 83
{% if not report.table.errors.body %}
<h3>Problèmes de contenu</h3>
<p class="text">
    Aucune erreur de contenu
</p>

{{ tables.preview(source_data) }}

{% endif %}

84
{% if report.table.errors.body %}
85 86

{% if not report.table.display_body_errors %}
Pierre Dittgen's avatar
Pierre Dittgen committed
87
<p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
88 89 90 91 92
    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
93
        tout de même les problèmes de contenu</a>
Pierre Dittgen's avatar
Pierre Dittgen committed
94
</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
95 96 97 98 99
<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
100 101 102
<div id="body_errors" style="display: none">
    {{ tables.body_errors(report, source_data) }}
</div>
103
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
104
<div>
Pierre Dittgen's avatar
Pierre Dittgen committed
105
    {{ tables.body_errors(report, source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
106
</div>
Pierre Dittgen's avatar
Pierre Dittgen committed
107 108 109
{% endif %}
{% endif %}

110

Pierre Dittgen's avatar
Pierre Dittgen committed
111
{% endif %}
112 113
{% endblock %}
{% block footer %}
114 115
<script>
    $(function () {
116
        // Errors tooltip activate
Pierre Dittgen's avatar
Pierre Dittgen committed
117 118 119
        $('[data-toggle="popover"]').popover({
            html: true,
            placement: 'auto',
120
            trigger: 'hover'
Pierre Dittgen's avatar
Pierre Dittgen committed
121
        });
122

Pierre Dittgen's avatar
Pierre Dittgen committed
123 124 125 126
        // Show body errors
        $('#show_body_errors').on('click', function () {
            $('#body_errors').show();
            $(this).remove();
127
        })
128 129
    })
</script>
130 131 132 133 134 135

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