nineskeletor/templates/Blog/list.html.twig

59 lines
2.0 KiB
Twig
Raw Permalink Normal View History

2023-02-16 17:03:53 +01:00
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
blogs
</h1>
<p><a class="btn btn-success" href={{ path('app_blog_submit') }}>Ajouter</a></p>
<div class="card">
<div class="card-header">
<i class="fa fa-table fa-fw"></i> Liste des blogs
</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="90px" class="no-sort">Action</th>
<th class="no-string" width="70px">ID</th>
<th width="70px">Date</th>
<th width="200px">Type</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for blog in blogs %}
<tr>
<td>
<a href="{{path("app_child",{catparent:"blog",idparent:blog.id})}}"><i class="fa fa-file fa-2x"></i></a>
</td>
<td>{{blog.id}}</td>
<td>{{blog.submitdate|date("Y-m-d")}}</td>
<td>{{blog.blogtype.name}}</td>
<td>{{blog.name}}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
{% endblock %}
{% block localscript %}
<script>
$(document).ready(function() {
$('#dataTables').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 100,
order: [[ 2, "asc" ]]
});
});
</script>
{% endblock %}