92 lines
3.1 KiB
Twig
92 lines
3.1 KiB
Twig
{% extends '@CadolesCore/base.html.twig' %}
|
|
|
|
|
|
{% block pagewrapper %}
|
|
<h1>
|
|
Gestion des Pages
|
|
</h1>
|
|
|
|
<p>
|
|
<a href="{{ path('cadoles_portal_config_page_submit') }}" class="btn btn-success">Ajouter une Page</a>
|
|
|
|
<span class="pull-right">
|
|
<label id="labelalluser" for="alluser" class="control-label" style="margin-right:15px">Afficher les pages créées par des utilisateurs</label>
|
|
<input id="alluser" name="alluser" type="checkbox" class="switch" onChange="switchalluser();">
|
|
</span>
|
|
</p>
|
|
|
|
<div class="panel panel-primary">
|
|
<div class="panel-heading">
|
|
<i class="fa fa-table fa-fw"></i> Liste des Pages
|
|
</div>
|
|
|
|
<div class="panel-body">
|
|
<div class="dataTable_wrapper">
|
|
<table class="table table-striped table-bordered table-hover" id="dataTables" style="width:100%">
|
|
<thead>
|
|
<tr>
|
|
<th width="120px" 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 %}
|
|
|
|
{% block localjavascript %}
|
|
$(document).ready(function() {
|
|
$(".switch").bootstrapSwitch();
|
|
{% 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").bootstrapSwitch('state',state);
|
|
{% endif %}
|
|
|
|
table = $('#dataTables').DataTable({
|
|
columnDefs: [ { "targets": 'no-sort', "orderable": false } ],
|
|
responsive: true,
|
|
iDisplayLength: 100,
|
|
order: [[ 1, "asc" ]],
|
|
processing: true,
|
|
serverSide: true,
|
|
ajax: {
|
|
"url": "{{ path('cadoles_portal_config_page_ajax_list') }}",
|
|
"data": function ( d ) {
|
|
return $.extend( {}, d, {
|
|
"alluser": $('#alluser').bootstrapSwitch('state')
|
|
});
|
|
}
|
|
},
|
|
|
|
drawCallback: function(settings) {
|
|
$("a[data-method='delete']").click(function(){
|
|
if( !confirm('Êtes-vous sûr de vouloir supprimer cette page ?')) {
|
|
return false;
|
|
}
|
|
});
|
|
}
|
|
});
|
|
});
|
|
|
|
function switchalluser() {
|
|
if (typeof table !== 'undefined') {
|
|
table.ajax.reload();
|
|
}
|
|
|
|
var check = $('#alluser').bootstrapSwitch('state');
|
|
if(check)
|
|
$("#labelalluser").html("Afficher les pages non liées à un utilisateur");
|
|
else
|
|
$("#labelalluser").html("Afficher les pages créées par des utilisateurs");
|
|
|
|
}
|
|
|
|
{% endblock %}
|