read.html.twig 4.72 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
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
    <table id="maintab" class="table legumes">
        <thead>
            <tr>
                <th scope="col">#</th>
                <th scope="col">Nom
                    <a href="#" class="btn-tri" id="btncol0_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol0_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Description
                    <a href="#" class="btn-tri" id="btncol1_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol1_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Unité
                    <a href="#" class="btn-tri" id="btncol2_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol2_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Qté min
                    <a href="#" class="btn-tri" id="btncol3_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol3_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Max
                    <a href="#" class="btn-tri" id="btncol3_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol3_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Step
                    <a href="#" class="btn-tri" id="btncol3_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol3_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Prix unitaire
                    <a href="#" class="btn-tri" id="btncol4_asc"><i class="fa fa-caret-down"></i></a>
                    <a href="#" class="btn-tri" id="btncol4_desc"><i class="fa fa-caret-up"></i></a>
                </th>
                <th scope="col">Action</th>
            </tr>
        </thead>
        <tbody>
            {% for legume in legumes %}
                <tr id="row{{ legume.id }}">
                    <th scope="row">{{ legume.id }}</th>
                    <td>{{ legume.nom }}</td>
                    <td>{{ legume.description }}</td>
                    <td>{{ legume.unite }}</td>
                    <td>{{ legume.quantiteMin }}</td>
                    <td>{{ legume.quantiteMax }}</td>
                    <td>{{ legume.quantiteStep }}</td>
                    <td>{{ legume.prixUnitaire }}</td>
                    <td>
                        <a class="btn btn-primary btn-sm" role="button" href="{{ path('potage_legume_update', {'id': legume.id }) }}">Editer</a>
Mat's avatar
Mat committed
65

Mat's avatar
Mat committed
66
67
68
69
70
                        <a class="btn btn-danger btn-sm" role="button" href="#" id="btn-{{ legume.id }}">Effacer</a>
                        <div class="modal modal-{{ legume.id }} fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                            <div class="modal-dialog" role="document">
                                <div class="modal-content">
                                    <div class="modal-header">
Mat's avatar
Mat committed
71
                                        <h5 class="modal-title">Effacer le légume n°{{ legume.id }}</h5>
Mat's avatar
Mat committed
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
                                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                            <span aria-hidden="true">&times;</span>
                                        </button>
                                    </div>
                                    <div class="modal-body">
                                        <p>Cette action n'est pas réversible. Souhaitez-vous continuer ?</p>
                                    </div>
                                    <div class="modal-footer">
                                        <button type="button" class="btn btn-secondary" data-dismiss="modal">Annuler</button>
                                        <a class="btn btn-danger" role="button" href="{{ path('potage_legume_delete', {'id': legume.id }) }}">
                                            Oui, effacer !
                                        </a>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </td>
                </tr>
            {% endfor %}
        </tbody>
    </table>
Mat's avatar
Mat committed
94
{% endblock %}