validation_form.html 4.24 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
<h1 class="my-4">Formulaire de validation</h1>
Pierre Dittgen's avatar
wip  
Pierre Dittgen committed
6
7
8
9
10
11
12
13
14
15
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
{#
{% 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 }}
          {% if val_info.version %}
          <span class="badge badge-primary">{{ val_info.version }}</span>
          {% else %}
          <span
            class="badge badge-primary"
            title="Schéma en cours de développement"
            >dev</span
          >
          {% endif %}
        </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 %} Auteur : {{ val_info.author }}
          {% endif %} {% if val_info.contributor %}
          <br />Contributeur(s) : {{ val_info.contributor }}
          {% endif %}
        </p>
        {% endif %}
      </div>
    </div>
  </div>
</div>
#}

<div class="row">
  <div class="col-md-8 {{ cols_my_classes }}">
    <!-- 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>
    </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"
      >#}
      <h2>Valider un fichier</h2>
      <div>
        <form method="POST" enctype="multipart/form-data">
          <input type="hidden" name="input" value="file" />
          <div class="form-group">
            <label for="schema">Indiquez l'URL du schema de validation</label>
            <input
              name="schema"
              type="url"
              class="form-control"
              aria-describedby="urlHelp"
              placeholder="https://..."
            />
          <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>
      <h2>Valider une URL</h2>
      <div
        class="tab-pane {{ 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="schema">Indiquez l'URL du schema de validation</label>
            <input
              name="schema"
              type="url"
              class="form-control"
              id="schema"
              aria-describedby="urlHelp"
              placeholder="https://..."
            />
          <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>
    </div>
  </div>
</div>

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