v1.5.8 Made backend to modal and preview, only frontend

This commit is contained in:
2021-04-09 10:32:45 +02:00
parent b5075fe209
commit 3d2f07d3d8
3 changed files with 32 additions and 1 deletions
@@ -26,6 +26,7 @@
<th>Udløbsdato</th>
@if(auth()->user()->can('news.edit'))
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/pencil.svg') }}" alt="Update"></th>
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/preview.svg') }}" alt="Update"></th>
@endif
@if(auth()->user()->can('news.delete'))
<th class="w-1em"><img class="w-100" src="{{ asset('/images/icons/trashcan.svg') }}" alt="Delete"></th>
@@ -42,6 +43,7 @@
@endif
@if(auth()->user()->can('news.edit'))
<td><a href="{{ route("news.edit", [ "news" => $new ]) }}"><img class="w-100" src="{{ asset('/images/icons/pencil-dark.svg') }}" alt="Update"></a></td>
<td><a href="#" id="preview" onclick="getPreviewValue({{$new->id}})" ><img class="w-100" src="{{ asset('/images/icons/preview-dark.svg') }}" alt="Update"></a></td>
@endif
@if(auth()->user()->can('news.delete'))
<td>
@@ -59,7 +61,7 @@
$(document).ready( function () {
$('#table_id').DataTable({
columnDefs: [
{ orderable: false, targets: [-1, -2] }
{ orderable: false, targets: [-1, -2, -3] }
]
});
});
@@ -98,5 +100,25 @@
}
})
}
//Get the id and
function getPreviewValue(elm){
$.ajax({
type: 'get',
url: '{{route('events.preview')}}',
data: {'preview':elm},
success:function (data) {
$l = JSON.parse(data);
console.log($l);
},
error:function (data) {
console.log(data);
}
});
}
</script>
@endsection