nineskeletor/templates/Audit/list.html.twig

66 lines
2.1 KiB
Twig
Raw Permalink Normal View History

2022-07-26 16:03:53 +02:00
{% extends "base.html.twig" %}
{% block body %}
<h1 class="page-header">
AUDIT {{ entityname }}
</h1>
<div class="card mt-3" >
<div class="card-header">
<i class="fas fa-eye fa-fw"></i> Audit
</div>
<div id="bodyaudit" class="card-body">
<table class="table table-striped table-bordered table-hover dataTable" style="width:100%; zoom:80%">
<thead>
<tr>
<th>Date</th>
<th>Par</th>
<th>Action</th>
<th>Id</th>
<th>Détail</th>
</tr>
</thead>
<tbody>
{% for audit in audits|reverse %}
<tr>
<td>{{audit.datesubmit|date("d/m/Y H:i")}}</td>
<td>{{audit.username}}</td>
<td>{{audit.description}}</td>
<td>{{audit.entityid}}</td>
<td>
<small>
{% for key, detail in audit.detail %}
{% if audit.description=="UPDATE" %}
<strong>{{key}}</strong> =
de {%if detail[0] is empty%}null {%else%}{{detail[0]|join(', ')}}{%endif%}
à {%if detail[1] is empty%}null {%else%} {{detail[1]|join(', ')}}{%endif%}
</br>
{% else %}
<strong>id</strong> {{detail}}
{% endif %}
{% endfor %}
</small>
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endblock %}
{% block localscript %}
<script>
$(document).ready(function() {
$('.table').DataTable({
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
responsive: true,
iDisplayLength: 100,
order: [[ 0, "desc" ]],
});
});
</script>
{% endblock %}