validation_form.html 4.38 KB
Newer Older
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
1
2
3
4
{% extends "base_template.html" %} {% block title %}{{ title }}{% endblock %} {%
block head %}
{{ super() }}
{% endblock %} {% block content %}
Pierre Dittgen's avatar
Pierre Dittgen committed
5
6
<h1 class="my-4">{{ title }}</h1>

Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
7
8
{% set cols_my_classes = 'my-md-0 my-4' %}
<div class="row">
Pierre Dittgen's avatar
Pierre Dittgen committed
9
10
11
12
13
14
    <div class="col-md-4 {{ cols_my_classes }}">
        <div class="card bg-faded">
            <div class="card-body">
                    {% include 'schema_info_part.html' %}
            </div>
        </div>
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
15
    </div>
Pierre Dittgen's avatar
Pierre Dittgen committed
16
17
18
19
20
21
22
23
24
25
26
27
28
    <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">
                <a class="nav-link" id="url-tab" data-toggle="tab" href="#url" role="tab" aria-controls="url"
                    aria-selected="false">URL</a>
            </li>
29
30
31
32
33
34
            {% if schema_info.resources %}
            <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>
            {% endif %}
Pierre Dittgen's avatar
Pierre Dittgen committed
35
36
37
38
39
40
        </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" />
41
42
43
                    {% for key, value in schema_params.items() %}
                    <input type="hidden" name="{{ key }}" value="{{ value }}" />
                    {% endfor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
44
45
46
47
48
49
50
51
52
53
54
                    <div class="form-group">
                        <label for="file">Choisissez un fichier tabulaire à valider (.xlsx, .xls, .ods, .csv, .tsv,
                            etc.)</label>
                        <input type="file" class="form-control-file" name="file" id="file" accept=".csv, .xls, .xlsx, .ods" />
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
            </div>
            <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" />
55
56
57
                    {% for key, value in schema_params.items() %}
                    <input type="hidden" name="{{ key }}" value="{{ value }}" />
                    {% endfor %}
Pierre Dittgen's avatar
Pierre Dittgen committed
58
59
60
61
62
63
64
65
                    <div class="form-group">
                        <label for="url">Indiquez l'URL de la table à valider</label>
                        <input name="url" type="url" class="form-control" id="url" aria-describedby="urlHelp"
                            placeholder="https://..." />
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
            </div>
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
            {% if schema_info.resources %}
            <div class="tab-pane fade {{ padding_class }}" id="example" role="tabpanel" aria-labelledby="examples-tab">
                <form method="GET">
                    <input name="input" value="example" type="hidden">
                    {% for key, value in schema_params.items() %}
                    <input type="hidden" name="{{ key }}" value="{{ value }}" />
                    {% endfor %}
                    <div class="form-group">
                        <label for="url">Choisissez l'exemple à valider</label>
                        <select name="url" id="url" class="form-control">
                            <option value="">...</option>
                            {% for res in schema_info.resources %}
                            <option value="{{ res.path }}">{{ res.title }}</option>
                            {% endfor %}
                        </select>
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
            </div>
            {% endif %}
Pierre Dittgen's avatar
Pierre Dittgen committed
86
        </div>
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
87
88
89
    </div>
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
90

Christophe Benz's avatar
Christophe Benz committed
91
{% endblock %}