ninefolio/templates/Category/list.html.twig

56 lines
2.2 KiB
Twig
Raw Normal View History

2024-09-17 14:02:17 +02:00
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
CATEGORIES
</h1>
2024-10-30 22:06:14 +01:00
<p><a class="btn btn-success" href={{ path('app_category_submit',{by:"admin",userid:-1}) }}>Ajouter</a></p>
2024-09-17 14:02:17 +02:00
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> Liste des Catégories
</div>
<div class="card-body">
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
2024-10-30 22:06:14 +01:00
<th width="70px">Utilisateur</th>
2024-09-17 14:02:17 +02:00
<th width="70px">Ordre</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for category in categorys %}
<tr>
<td>
2024-10-30 22:06:14 +01:00
<a href="{{path("app_category_update",{id:category.id,by:'admin'})}}"><i class="fa fa-file"></i></a>
2024-09-17 14:02:17 +02:00
{% if category.id >=0 %}
2024-10-30 22:06:14 +01:00
<a href="{{path("app_category_delete",{id:category.id,by:'admin'})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
2024-09-17 14:02:17 +02:00
{% endif %}
</td>
2024-10-30 22:06:14 +01:00
<td>{{category.user.username}}</td>
2024-09-17 14:02:17 +02:00
<td>{{category.order}}</td>
<td>{{category.name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
$('#dataTables').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 100,
order: [[ 1, "asc" ]]
});
});
{% endblock %}