ninegate/src/cadolesuser-1.0/src/Cadoles/PortalBundle/Resources/views/Blog/list.html.twig

72 lines
2.3 KiB
Twig

{% extends '@CadolesCore/base.html.twig' %}
{% block pagewrapper %}
<h1>
Gestion des Blogs
</h1>
<p>
<a href="{{ path('cadoles_portal_config_blog_submit') }}" class="btn btn-success">Ajouter un Blog</a>
<span class="pull-right">
<label for="alluser" class="control-label">Afficher les 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 Calendriers
</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="100px" class="no-sort">Action</th>
<th>Nom</th>
<th>Propriétaire</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
{% endblock %}
{% block localjavascript %}
$(document).ready(function() {
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_blog_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 ce calendrier ?')) {
return false;
}
});
}
});
$(".switch").bootstrapSwitch();
});
function switchalluser() {
table.ajax.reload()
}
{% endblock %}