[WIP] Working on uploader
This commit is contained in:
34
resources/views/components/uploader/mini-gallery.blade.php
Normal file
34
resources/views/components/uploader/mini-gallery.blade.php
Normal file
@@ -0,0 +1,34 @@
|
||||
@if ($images)
|
||||
<div class="row" id="uploader-mini-gallery">
|
||||
@foreach($images as $image)
|
||||
<figure class="mr-2">
|
||||
<img src="{{ $image['url'] }}" class="img-thumbnail img-caption" style="max-height:92px;">
|
||||
<figcaption class="text-center pt-2">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary">
|
||||
<i class="fas fa-expand-alt" data-id="{{ $image['id'] }}"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-outline-danger">
|
||||
<i class="fas fa-trash" data-id="{{ $image['id'] }}"></i>
|
||||
</button>
|
||||
</figcaption>
|
||||
</figure>
|
||||
@endforeach
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$('#uploader-mini-gallery .fa-trash').click(function() {
|
||||
id = $(this).data('id');
|
||||
console.log(id);
|
||||
$.ajax({
|
||||
type: 'DELETE',
|
||||
url: {{ route('Botanic.Admin.Varieties.deleteImage') }},
|
||||
data: {id: id},
|
||||
success: function(data) {
|
||||
source = data;
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
Reference in New Issue
Block a user