read.html.twig 1.93 KB
Newer Older
Mat's avatar
Mat committed
1
2
3
{% extends '@Potage/layout.html.twig' %}

{% block title %}
Mat's avatar
Mat committed
4
    Liste des légumes
Mat's avatar
Mat committed
5
6
7
8
9
10
11
12
{% endblock %}

{% block content %}

    {{ block('breadcrumb') }}

    <h1>{{ block('title') }}</h1>

Mat's avatar
Mat committed
13
14
15
16
    <p>
        <a href="{{ path('potage_legume_create') }}"><i class="fas fa-plus fa-fw"></i>Ajouter un légume</a>
    </p>

Mat's avatar
Mat committed
17
18
19
    <table id="maintab" class="table legumes">
        <thead>
            <tr>
20
21
22
23
24
                {% set cols = ["#", "Nom", "Description", "Unité", "Qté min", "Max", "Step", "Prix unitaire"] %}
                {% for col in cols %}
                <th scope="col">{{col}}
                    <a href="#" class="btn-tri" id="btncol{{ loop.index0 }}_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol{{ loop.index0 }}_desc"><i class="fa fa-caret-up"></i></a>
Mat's avatar
Mat committed
25
                </th>
26
                {% endfor %}
Mat's avatar
Mat committed
27
28
29
30
31
32
                <th scope="col">Action</th>
            </tr>
        </thead>
        <tbody>
            {% for legume in legumes %}
                <tr id="row{{ legume.id }}">
33
                    <td scope="row">{{ legume.id }}</td>
Mat's avatar
Mat committed
34
35
36
37
38
39
                    <td>{{ legume.nom }}</td>
                    <td>{{ legume.description }}</td>
                    <td>{{ legume.unite }}</td>
                    <td>{{ legume.quantiteMin }}</td>
                    <td>{{ legume.quantiteMax }}</td>
                    <td>{{ legume.quantiteStep }}</td>
40
                    <td>{{ legume.prixUnitaire }} €/{{ legume.unite }}</td>
Mat's avatar
Mat committed
41
42
43
                    <td>
                        <a class="btn btn-primary btn-sm" role="button" href="{{ path('potage_legume_update', {'id': legume.id }) }}">Editer</a>
                        <a class="btn btn-danger btn-sm" role="button" href="#" id="btn-{{ legume.id }}">Effacer</a>
44
                        {% include '@Potage/Legume/delete-modal.html.twig' %}
Mat's avatar
Mat committed
45
46
47
48
49
                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
Mat's avatar
Mat committed
50
{% endblock %}