validation_form.html 3.99 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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
    <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>
            {#
            <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" />
                    <input type="hidden" name="schema" value="{{ schema_url }}" />
                    <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" />
                    <input type="hidden" name="schema" value="{{ schema_url }}" />
                    <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://..." />
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
58

Pierre Dittgen's avatar
Pierre Dittgen committed
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
                    </div>
                    <button type="submit" class="btn btn-primary">Valider</button>
                </form>
            </div>
            {#
            <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>
            </div>
            #}
        </div>
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
81
82
83
    </div>
</div>

Pierre Dittgen's avatar
Pierre Dittgen committed
84

Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
85
{% endblock %} {% block footer %} {% endblock %}