85 lines
2.1 KiB
PHP
85 lines
2.1 KiB
PHP
@extends('boilerplate::layout.index', [
|
|
'title' => __('permissions.title'),
|
|
'subtitle' => __('permissions.list.title'),
|
|
'breadcrumb' => ['Utilisateurs', 'Permissions']
|
|
])
|
|
|
|
@section('content')
|
|
<div class="row">
|
|
<div class="col-sm-12 mbl">
|
|
<span class="pull-right">
|
|
<a href="{{ route("boilerplate.Users.Permissions.create") }}" class="btn btn-primary">{{ __('permissions.create.title') }}</a>
|
|
</span>
|
|
</div>
|
|
</div>
|
|
<div class="box box-info">
|
|
<div class="box-body">
|
|
<table class="table table-striped table-hover va-middle" id="permissions-table">
|
|
<thead>
|
|
<tr>
|
|
<th>{{ __('permissions.name') }}</th>
|
|
<th>{{ __('permissions.label') }}</th>
|
|
<th>{{ __('permissions.description') }}</th>
|
|
<th>{{ __('permissions.list.nbusers') }}</th>
|
|
<th></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
@foreach($permissions as $permission)
|
|
<tr>
|
|
<td>
|
|
<strong>{{ $permission->name }}</strong>
|
|
</td>
|
|
<td>
|
|
<strong>{{ $permission->display_name }}</strong>
|
|
</td>
|
|
<td>
|
|
{{ $permission->description }}<br />
|
|
</td>
|
|
<td>
|
|
|
|
</td>
|
|
<td>
|
|
<a href="{{ route('boilerplate.Users.Permissions.edit', $permission->id) }}" class="btn btn-sm btn-primary">
|
|
<span class="fa fa-pencil"></span>
|
|
</a>
|
|
</td>
|
|
</tr>
|
|
@endforeach
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
@endsection
|
|
|
|
@include('boilerplate::load.datatables')
|
|
|
|
@push('js')
|
|
<script>
|
|
$(function () {
|
|
|
|
$('#permissions-table').dataTable();
|
|
|
|
$('#permissions-table').on('click', '.destroy', function (e) {
|
|
e.preventDefault();
|
|
|
|
var href = $(this).attr('href');
|
|
var line = $(this).closest('tr');
|
|
|
|
bootbox.confirm("{{ __('boilerplate::permission.list.confirmdelete') }}", function (result) {
|
|
if (result === false) return;
|
|
|
|
$.ajax({
|
|
url: href,
|
|
method: 'delete',
|
|
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
|
success: function(){
|
|
line.remove();
|
|
growl("{{ __('boilerplate::permission.list.deletesuccess') }}", 'success');
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
@endpush |