first commit symfony 6
This commit is contained in:
66
templates/Audit/list.html.twig
Normal file
66
templates/Audit/list.html.twig
Normal file
@ -0,0 +1,66 @@
|
||||
{% 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 %}
|
68
templates/Audit/render.html.twig
Normal file
68
templates/Audit/render.html.twig
Normal file
@ -0,0 +1,68 @@
|
||||
|
||||
<div class="card mt-3" >
|
||||
<div class="card-header" onClick="switchAudit()">
|
||||
<i class="fas fa-eye fa-fw"></i> Audit
|
||||
<div id="btnaudit" class="btn btn-secondary float-end btn-sm" style="font-family:var(--fontbody)">
|
||||
{%if not app.session.get("fgaudit")%}Afficher{%else%}Masquer{%endif%}</div>
|
||||
</div>
|
||||
|
||||
<div id="bodyaudit" class="card-body" style="{%if not app.session.get("fgaudit")%}display:none;{%endif%}">
|
||||
<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>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>
|
||||
<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>
|
||||
|
||||
<script>
|
||||
function switchAudit() {
|
||||
{% if app.user %}
|
||||
$.ajax({
|
||||
method: "POST",
|
||||
url: "{{ path('app_user_preference') }}",
|
||||
data: {
|
||||
id:0,
|
||||
key:'fgaudit',
|
||||
value: !($("#bodyaudit").is(":visible"))
|
||||
},
|
||||
success: function() {
|
||||
}
|
||||
});
|
||||
$("#bodyaudit").toggle();
|
||||
if($("#bodyaudit").is(":visible"))
|
||||
$("#btnaudit").html("Masquer");
|
||||
else
|
||||
$("#btnaudit").html("Afficher");
|
||||
{% endif %}
|
||||
}
|
||||
</script>
|
Reference in New Issue
Block a user