validation_report.html 4.06 KB
Newer Older
1
{% extends "base_template.html" %}
2 3 4
{% block title %}{{ title }}{% endblock %}
{% block head %}
{{ super() }}
Pierre Dittgen's avatar
Pierre Dittgen committed
5 6 7 8 9 10
<style>
    .popover .popover-body h2 {
        font-size: 1.2em;
        font-weight: bold;
    }
</style>
11 12 13
{% endblock %}
{% block content %}
<h1>{{ title }}</h1>
14
<p class="text">Validation effectuée {{ validation_date }}</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
15 16 17
<p class="text alert alert-info">
    Pour relancer la validation, <a href="#" onclick="location.reload();">rechargez</a> la page.
</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
18
{# Schema info #}
Pierre Dittgen's avatar
Pierre Dittgen committed
19
<div class="row">
Christophe Benz's avatar
Christophe Benz committed
20
    <div class="col-md-5 my-4">
Pierre Dittgen's avatar
Pierre Dittgen committed
21 22 23 24 25 26 27
        <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
28
                {% if val_info.author or val_info.contributor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
29
                <p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
30 31 32 33 34 35 36 37 38 39 40 41
                    {% 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 />
Pierre Dittgen's avatar
Pierre Dittgen committed
42
                <p class="text alert alert-secondary" style="margin-bottom: 0;">
43
                    Source
Pierre Dittgen's avatar
Pierre Dittgen committed
44 45 46 47 48 49 50
                    {% if source_type == 'file' %}
                    (fichier) : <em>{{ source.name }}</em>
                    {% endif %}
                    {% if source_type == 'url' %}
                    (URL) : <em><a href="{{source.name}}" target="_blank" title="{{source.name}}">{{source.name |
                            truncate(60)}}</a></em>
                    {% endif %}
51 52
                    <br />
                    Dimensions : <em>{{ report.table.col_count }} colonnes et {{ report.table.row_count }} lignes</em>
Pierre Dittgen's avatar
Pierre Dittgen committed
53 54 55
                </p>
            </div>
        </div>
56 57 58
    </div>
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
59
{% import 'table_macros.html' as tables %}
Pierre Dittgen's avatar
Pierre Dittgen committed
60

61
{% if report.error_count == 0 %}
62 63
<h2>La table est valide</h2>
<p>Aucune erreur détectée</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
64

Pierre Dittgen's avatar
Pierre Dittgen committed
65
{{ tables.preview(source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
66

67
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
68

69
<h2>La table est invalide</h2>
Pierre Dittgen's avatar
Pierre Dittgen committed
70

Pierre Dittgen's avatar
Pierre Dittgen committed
71
{# table checks #}
Pierre Dittgen's avatar
Pierre Dittgen committed
72

73
{% if report.table.errors.structure %}
Pierre Dittgen's avatar
Pierre Dittgen committed
74
<div>
75
    <h3>Problèmes de structure</h3>
76 77 78 79 80
    {% for err in report.table.errors.structure %}
    <div class="alert alert-danger">
        {{ err.message | safe}}
    </div>
    {% endfor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
81
</div>
82
{% endif %}
83

Pierre Dittgen's avatar
Pierre Dittgen committed
84
<!-- row checks -->
85

86 87 88 89 90 91 92 93 94 95
{% 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 %}

96
{% if report.table.errors.body %}
97 98

{% if not report.table.display_body_errors %}
Pierre Dittgen's avatar
Pierre Dittgen committed
99
<p class="text">
Pierre Dittgen's avatar
Pierre Dittgen committed
100 101 102 103 104
    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
105
        tout de même les problèmes de contenu</a>
Pierre Dittgen's avatar
Pierre Dittgen committed
106
</p>
Pierre Dittgen's avatar
Pierre Dittgen committed
107 108 109 110 111
<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
112 113 114
<div id="body_errors" style="display: none">
    {{ tables.body_errors(report, source_data) }}
</div>
115
{% else %}
Pierre Dittgen's avatar
Pierre Dittgen committed
116
<div>
Pierre Dittgen's avatar
Pierre Dittgen committed
117
    {{ tables.body_errors(report, source_data) }}
Pierre Dittgen's avatar
Pierre Dittgen committed
118
</div>
Pierre Dittgen's avatar
Pierre Dittgen committed
119 120 121
{% endif %}
{% endif %}

122

Pierre Dittgen's avatar
Pierre Dittgen committed
123
{% endif %}
124 125
{% endblock %}
{% block footer %}
126 127
<script>
    $(function () {
128
        // Errors tooltip activate
Pierre Dittgen's avatar
Pierre Dittgen committed
129 130 131
        $('[data-toggle="popover"]').popover({
            html: true,
            placement: 'auto',
132
            trigger: 'hover'
Pierre Dittgen's avatar
Pierre Dittgen committed
133
        });
134

Pierre Dittgen's avatar
Pierre Dittgen committed
135 136 137 138
        // Show body errors
        $('#show_body_errors').on('click', function () {
            $('#body_errors').show();
            $(this).remove();
139
        })
140 141
    })
</script>
142 143 144 145 146 147

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