2023-01-12 16:14:31 +01:00
|
|
|
{% extends 'base.html.twig' %}
|
|
|
|
|
|
|
|
|
|
|
|
{% block body %}
|
|
|
|
<h1 class="page-header">
|
|
|
|
Gestion des Pages
|
|
|
|
</h1>
|
|
|
|
|
2023-01-23 09:46:34 +01:00
|
|
|
<a href="{{ path('app_'~access~'_page_'~usage~'_submit') }}" class="btn btn-success">Ajouter une Page</a>
|
2023-01-12 16:14:31 +01:00
|
|
|
|
|
|
|
<div class="custom-control custom-switch float-right">
|
|
|
|
<input id="alluser" type="checkbox" class="custom-control-input">
|
|
|
|
<label id="labelalluser" class="custom-control-label" for="alluser">Afficher les pages créées par des utilisateurs</label>
|
|
|
|
</div>
|
|
|
|
<br><br>
|
|
|
|
|
|
|
|
<div class="card">
|
|
|
|
<div class="card-header">
|
|
|
|
<i class="fa fa-table fa-fw"></i> Liste des Pages
|
|
|
|
</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="140px" class="no-sort">Action</th>
|
|
|
|
<th>Ordre</th>
|
|
|
|
<th>Nom</th>
|
|
|
|
<th class="no-sort">Catégorie</th>
|
|
|
|
<th>Propriétaire</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
</table>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{% endblock %}
|
|
|
|
|
2023-01-23 09:46:34 +01:00
|
|
|
{% block localscript %}
|
|
|
|
<script>
|
2023-01-12 16:14:31 +01:00
|
|
|
$(document).ready(function() {
|
|
|
|
{% if not app.session.get('alluserpage') is empty %}
|
|
|
|
var state={{ app.session.get('alluserpage') }};
|
|
|
|
if(state) {
|
|
|
|
$("#labelalluser").html("Afficher les pages non liées à un utilisateur");
|
|
|
|
$("#alluser").attr('checked', true);
|
|
|
|
}
|
|
|
|
{% endif %}
|
|
|
|
|
|
|
|
table = $('#dataTables').DataTable({
|
|
|
|
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
|
|
|
responsive: true,
|
|
|
|
iDisplayLength: 100,
|
|
|
|
order: [[ 1, "asc" ]],
|
|
|
|
processing: true,
|
|
|
|
serverSide: true,
|
|
|
|
ajax: {
|
2023-01-23 09:46:34 +01:00
|
|
|
"url": "{{ path('app_'~access~'_page_'~usage~'_tablelist') }}",
|
2023-01-12 16:14:31 +01:00
|
|
|
"data": function ( d ) {
|
|
|
|
return $.extend( {}, d, {
|
|
|
|
"alluser": $('#alluser').is(':checked')
|
|
|
|
});
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
drawCallback: function(settings) {
|
|
|
|
$("a[data-method='delete']").click(function(){
|
|
|
|
if( !confirm('Êtes-vous sûr de vouloir supprimer cette page ?')) {
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#alluser').change(function() {
|
|
|
|
if (typeof table !== 'undefined') {
|
|
|
|
table.ajax.reload();
|
|
|
|
}
|
|
|
|
|
|
|
|
var check = $('#alluser').is(':checked');
|
|
|
|
if(check)
|
|
|
|
$("#labelalluser").html("Afficher les pages non liées à un utilisateur");
|
|
|
|
else
|
|
|
|
$("#labelalluser").html("Afficher les pages créées par des utilisateurs");
|
|
|
|
|
|
|
|
});
|
2023-01-23 09:46:34 +01:00
|
|
|
</script>
|
2023-01-12 16:14:31 +01:00
|
|
|
{% endblock %}
|