ninefolio/templates/Webzine/listrender.html.twig

51 lines
2.2 KiB
Twig
Raw Normal View History

2024-10-31 11:48:30 +01:00
<p><a class="btn btn-success" href={{ path('app_webzine_submit',{by:by,userid:userid}) }}>Ajouter</a></p>
<div class="dataTable_wrapper">
<table class="table table-striped table-bordered table-hover" id="webzines" style="width:100%">
<thead>
<tr>
<th width="70px" class="no-sort">Action</th>
<th width="70px" class="no-sort">Miniature</th>
<th width="100px">Serie</th>
<th>Nom</th>
</tr>
</thead>
<tbody>
{% for webzine in webzines %}
<tr>
<td>
<a href="{{path("app_webzine_update",{id:webzine.id,by:by})}}"><i class="fa fa-file"></i></a>
{% if webzine.id >=0 %}
<a href="{{path("app_webzine_delete",{id:webzine.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>
{% if not webzine.webzinepages is empty %}
{% set source="thumbori_"~webzine.webzinepages[0].illustration %}
{% set height=30*90/21 %}
<div style="width:90px; height:{{ height }}px;background-position: center ; background-size: cover; background-image: url(/{{ appAlias }}/uploads/webzine/{{source}}");">
{% endif %}
</td>
<td>{{ webzine.set }} #{{ webzine.order| format_number({min_integer_digit:'2'})}}</td>
<td>{{ webzine.name }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
<script>
$(document).ready(function() {
$('#webzines').DataTable({
columnDefs: [ { "targets": "no-sort", "orderable": false }, { "targets": "no-string", "type" : "num" } ],
responsive: true,
iDisplayLength: 10,
order: [[ 2, "desc" ]]
});
});
</script>