ninefolio/templates/Category/listrender.html.twig

38 lines
1.5 KiB
Twig

<p><a class="btn btn-success" href={{ path('app_category_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper" style="zoom:80%" >
<table class="table table-striped table-bordered table-hover" id="categorys" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px">Ordre</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for category in categorys %}
<tr>
<td>
<a href="{{path("app_category_update",{id:category.id,by:by})}}"><i class="fa fa-file"></i></a>
{% if category.id >=0 %}
<a href="{{path("app_category_delete",{id:category.id,by:by})}}" data-method="delete" data-confirm="Êtes-vous sûr de vouloir supprimer cet enregistrement ?"><i class="fa fa-trash"></i></a>
{% endif %}
</td>
<td>{{category.order}}</td>
<td>{{category.name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
$(document).ready(function() {
$('#categorys').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 1, "asc" ]]
});
});
</script>