scdl_validation_form.html 4.73 KB
Newer Older
1
{% extends "base_template.html" %}
2 3 4 5 6
{% block title %}{{ title }}{% endblock %}
{% block head %}
{{ super() }}
{% endblock %}
{% block content %}
Christophe Benz's avatar
Christophe Benz committed
7
<h1 class="my-4">Schéma « {{ title }} »</h1>
8

Christophe Benz's avatar
Christophe Benz committed
9 10 11 12 13 14 15
{% set cols_my_classes = 'my-md-0 my-4' %}
<div class="row">
    <div class="col-md-4 {{ cols_my_classes }}">
        <div class="card bg-faded">
            <div class="card-body">
                <h5 class="card-title">
                    Schéma {{ val_info.code }}
16
                    {% if val_info.version %}
Christophe Benz's avatar
Christophe Benz committed
17
                    <span class="badge badge-primary">{{ val_info.version }}</span>
18
                    {% else %}
19
                    <span class="badge badge-primary" title="Schéma en cours de développement">dev</span>
20
                    {% endif %}
Christophe Benz's avatar
Christophe Benz committed
21 22 23 24 25
                </h5>
                <h6 class="card-subtitle mb-2 text-muted">{{ val_info.description }}</h6>
                {% if val_info.author or val_info.contributor %}
                <p class="text">
                    {% if val_info.author %}
Christophe Benz's avatar
Christophe Benz committed
26
                    Auteur : {{ val_info.author }}
Christophe Benz's avatar
Christophe Benz committed
27 28 29 30 31 32
                    {% endif %}
                    {% if val_info.contributor %}
                    <br />Contributeur(s) : {{ val_info.contributor }}
                    {% endif %}
                </p>
                {% endif %}
33
                <a href="{{ val_info.doc_url }}" target="_blank" class="card-link">Documentation</a>
Christophe Benz's avatar
Christophe Benz committed
34 35
            </div>
        </div>
36 37
    </div>

Christophe Benz's avatar
Christophe Benz committed
38 39 40 41 42 43 44 45 46 47
    <div class="col-md-8 {{ cols_my_classes }}">
        <h2>Outil de validation</h2>
        <!-- Tab validator -->
        <p class="text">Validez ici le fichier de votre choix</p>
        <ul class="nav nav-tabs" id="myTab" role="tablist">
            <li class="nav-item">
                <a class="nav-link active" id="file-tab" data-toggle="tab" href="#file" role="tab" aria-controls="file"
                    aria-selected="true">Fichier</a>
            </li>
            <li class="nav-item">
Pierre Dittgen's avatar
Pierre Dittgen committed
48 49
                <a class="nav-link" id="url-tab" data-toggle="tab" href="#url" role="tab" aria-controls="url"
                    aria-selected="false">URL</a>
Christophe Benz's avatar
Christophe Benz committed
50 51 52 53 54 55 56 57 58 59 60 61
            </li>
            <li class="nav-item">
                <a class="nav-link" id="examples-tab" data-toggle="tab" href="#example" role="tab" aria-controls="examples"
                    aria-selected="false">Exemples</a>
            </li>
        </ul>
        {% set padding_class = 'p-3' %}
        <div class="tab-content" id="myTabContent">
            <div class="tab-pane fade show active {{ padding_class }}" id="file" role="tabpanel" aria-labelledby="file-tab">
                <form method="POST" enctype="multipart/form-data">
                    <input type="hidden" name="input" value="file" />
                    <div class="form-group">
62 63
                        <label for="file">Choisissez un fichier tabulaire à valider (.xlsx, .xls, .ods, .csv, .tsv,
                            etc.)</label>
64
                        <input type="file" class="form-control-file" name="file" id="file" accept=".csv, .xls, .xlsx, .ods" />
Christophe Benz's avatar
Christophe Benz committed
65 66 67
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
68
            </div>
Christophe Benz's avatar
Christophe Benz committed
69 70 71 72 73
            <div class="tab-pane fade {{ padding_class }}" id="url" role="tabpanel" aria-labelledby="url-tab">
                <form method="GET">
                    <input type="hidden" name="input" value="url" />
                    <div class="form-group">
                        <label for="url">Indiquez l'URL de la table à valider</label>
Pierre Dittgen's avatar
Pierre Dittgen committed
74 75
                        <input name="url" type="url" class="form-control" id="url" aria-describedby="urlHelp"
                            placeholder="https://..." />
76

Christophe Benz's avatar
Christophe Benz committed
77 78 79
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
80
            </div>
Christophe Benz's avatar
Christophe Benz committed
81 82 83 84 85 86 87 88 89 90 91 92 93 94
            <div class="tab-pane fade {{ padding_class }}" id="example" role="tabpanel" aria-labelledby="examples-tab">
                <form method="GET">
                    <input type="hidden" name="input" value="example" />
                    <div class="form-group">
                        <label for="url">Choisissez l'exemple à valider</label>
                        <select name="url" id="example" class="form-control">
                            <option value="">...</option>
                            {% for example in val_info.examples %}
                            <option value="{{ example.url }}">{{ example.name }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
95
            </div>
Christophe Benz's avatar
Christophe Benz committed
96
        </div>
97 98 99 100 101
    </div>
</div>

{% endblock %}
{% block footer %}
102
{% endblock %}