home.html 3.69 KB
Newer Older
Christophe Benz's avatar
Christophe Benz committed
1
2
3
{% extends "base_template.html" %}
{% block title %}Accueil{% endblock %}
{% block content %}
4
<div class="container">
5
6
7
8
9
10
11
12
13
14
15
16
  {% for section in sections %} {% if section.catalog %}
  <div class="my-5">
    <h2>{{ section.title }}</h2>
    {% if section.description %}
    <p class="text-muted">{{ section.description | safe }}</p>
    {% endif %}
    <form action="{{ url_for('custom_validator') }}" method="GET">
      <div class="form-row">
        <div class="form-group col-lg-9">
          <select required name="schema_name" class="form-control">
            <option disabled selected value="">Choisissez un schéma</option>
            {% for item in section.catalog %}
Pierre Dittgen's avatar
Pierre Dittgen committed
17
            <option {%if item.err%}disabled{%endif%}
18
19
20
21
22
23
24
25
26
27
28
              value="{{ section.name }}.{{ item.name }}"
              >{{ item.title }}</option
            >
            {% endfor %}
          </select>
        </div>
        <div class="form-group col-lg-3">
          <button type="submit" class="btn btn-primary">
            Valider un fichier
          </button>
        </div>
Christophe Benz's avatar
Christophe Benz committed
29
      </div>
30
31
32
33
34
35
36
37
38
39
    </form>
  </div>
  {% elif section.err %}
  <div class="my-5">
    <h2>{{ section.title }}</h2>
    {% if section.description %}
    <p class="text-muted">{{ section.description | safe }}</p>
    {% endif %}
    <div class="alert alert-danger" role="alert">
      Catalogue indisponible: {{ section.err | safe }}
Christophe Benz's avatar
Christophe Benz committed
40
    </div>
41
  </div>
42
  {% endif %} {% endfor %}
Christophe Benz's avatar
Christophe Benz committed
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
  <div class="my-5">
    <h2>Schéma à la carte</h2>
    <p class="text-muted">
      Indiquez ici l'URL d'un schéma que vous souhaitez utiliser pour valider un
      fichier.
    </p>
    <form
      action="{{ url_for('custom_validator') }}"
      data-cy="custom_schema_form"
      method="GET"
    >
      <div class="form-row">
        <div class="form-group col-lg-9">
          <input
            name="schema_url"
            type="url"
            class="form-control"
            id="schema_url"
            aria-describedby="urlHelpBlock"
            placeholder="https://example.com/schema.json"
            required
          />
          <small id="urlHelpBlock" class="form-text text-muted">
            Le schéma doit être au format
            <a
              href="https://frictionlessdata.io/docs/table-schema/"
              target="_blank"
              >Table Schema</a
            >.
          </small>
        </div>
        <div class="form-group col-lg-3">
          <button type="submit" class="btn btn-primary">
            Valider un fichier
          </button>
        </div>
Christophe Benz's avatar
Christophe Benz committed
80
      </div>
81
82
    </form>
  </div>
83

84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
  {% for section in sections %} {% if section.links %}
  <div class="my-5">
    <h2>{{ section.title }}</h2>
    {% if section.description %}
    <p class="text-muted">{{ section.description }}</p>
    {% endif %}
    <div class="row my-4">
      {% for item in section.links %}
      <div class="col-sm-4 mb-4">
        <div class="card h-100">
          <div class="card-body d-flex flex-column">
            <h4 class="card-title">{{ item.title }}</h4>
            <p class="card-text">{{ item.description }}</p>
            <a
              href="{{ item.website }}"
              target="_blank"
              class="btn btn-outline-secondary mt-auto"
              >Utiliser
              <i class="fas fa-external-link-alt ml-1"></i>
103
            </a>
104
          </div>
Pierre Dittgen's avatar
Pierre Dittgen committed
105
        </div>
Pierre Dittgen's avatar
wip    
Pierre Dittgen committed
106
      </div>
107
      {% endfor %}
108
    </div>
Christophe Benz's avatar
Christophe Benz committed
109
  </div>
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
  {% endif %} {% endfor %}
  {% block page_scripts %}
  <style>
  /* Error message display */
  .btn-xs {
    padding: .25rem .4rem;
    font-size: .875rem;
    line-height: .5;
    border-radius: .2rem;
  }
  #exception_info {
    padding-top: 1.3em;
    padding-bottom: 0;
    margin-bottom: 0;
  }
</style>
  {% endblock %}
127
</div>
Pierre Dittgen's avatar
wip    
Pierre Dittgen committed
128
{% endblock %}