aboutsummaryrefslogtreecommitdiff
path: root/templates/category/create.html
blob: e206898e54fc2ff07972cfaafc799a57958d439a (plain)
1
2
3
4
5
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
{% extends "base.html" %}

{% block title %}
  Nouvelle catégorie
{% endblock title %}

{% block main %}

  <div>
    <p class="g-Paragraph">
      <a class="g-Link g-Media__Large" href="/categories">
        Retour aux categories
      </a>
    </p>

    <form class="g-Form" action="/category/create" method="POST">
      <h1 class="g-H1">
        Nouvelle catégorie
      </h1>

      {% if error %}
        <div class="g-Form__Error">{{ error }}</div>
      {% endif %}

      <label class="g-Form__Label" for="name">Nom</label>
      <input
        name="name"
        class="g-Form__Input"
        id="name"
        value="{{ form.name | default(value="") }}"
        required
        {% if not form %} autofocus {% endif %}
      />

      <label class="g-Form__Label" for="color">Couleur</label>
      <input
        name="color"
        type="color"
        class="g-Form__Input g-Form__InputColor"
        id="color"
        value="{{ form.color | default(value="") }}"
        required
      />

      <div>
        <input class="g-Button__Validate" type="submit" value="Créer" />
      </div>
    </form>
  </div>

{% endblock main %}