This commit is contained in:
Mathieu Lagace
2019-10-19 15:16:24 -04:00
parent 799261a7d5
commit f26631bedf
4 changed files with 69 additions and 10 deletions

View File

@@ -33,7 +33,7 @@
@if($job->id == 1)
<button disabled class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
@else
<button class="btn btn-danger btn-just-icon"><i class="fa fa-close"></i></button>
<button class="btn btn-danger btn-just-icon" onclick="deleteJobs({{$job->id}})"><i class="fa fa-close"></i></button>
@endif
</div>
</div>
@@ -46,3 +46,43 @@
</div>
</div>
@endsection
@section('custom_scripts')
<script>
function deleteJobs(pid){
swal({
title: 'Êtes vous certain ?',
html:
'Vous ne pourrez annuler cette action! <br>' +
'<strong>Veuillez donner un nouveau poste a tous les utilisateurs posédant présentement le poste que vous voulez supprimer</strong>',
type: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Oui',
cancelButtonText: 'Non'
}).then((result) => {
if (result.value) {
(function($) {
$.post('/api/config/job/delete?api_token='+api_token, { id: pid } , function(data) {
console.log('Delete');
});
})(jQuery);
swal(
'Supprimé!',
"Le poste a été supprimé",
'success'
).then((result) => {
if (result.value) {
location.reload();
}
})
}
})
}
</script>
@endsection