Add preview from father, add new features
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
<div class="datatable-export-buttons">
|
||||
|
||||
@include('components.datatables.buttons.print')
|
||||
|
||||
@if (isset($with_exports) && $with_exports)
|
||||
@include('components.datatables.buttons.download')
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -38,7 +38,11 @@
|
||||
headers: {'X-CSRF-TOKEN': '{{ csrf_token() }}'},
|
||||
success: function(){
|
||||
// line.remove();
|
||||
table.draw();
|
||||
@if (isset($delete_callback))
|
||||
{{ $delete_callback }}
|
||||
@else
|
||||
table.draw();
|
||||
@endif
|
||||
growl("{{ __('admin.deletesuccess') }}", 'success');
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@include('load.autocomplete')
|
||||
@include('load.form.autocomplete')
|
||||
|
||||
<input type="hidden" name="{{ $name }}_id" id="{{ $name }}_id" value="{{ $data['id'] ?? null }}">
|
||||
<input type="text" name="{{ $name }}_name" class="form-control autocomplete" value="{{ $data['name'] ?? ''}}" data-url="{{ $url ?? ''}}" data-field="{{ $name }}_id" autocomplete="off">
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
@include('load.datepicker')
|
||||
@include('load.form.datepicker')
|
||||
|
||||
<div class="input-group date" data-target-input="nearest">
|
||||
@include('components.input', ['class' => 'datepicker', 'meta' => 'data-target="#'.str_slug($name).'"', 'placeholder' => App\Repositories\Core\DateTime::getLocaleFormatDate() ])
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
|
||||
@if(!defined('LOAD_EDITOR'))
|
||||
@include('load.editor')
|
||||
@include('load.form.editor.editor')
|
||||
@push('js')
|
||||
<script>
|
||||
$(function() {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
@include('components.input', ['type' => 'number', 'meta' => "step = '.01'"])
|
||||
|
||||
<div class="input-group-append">
|
||||
<button class="btn btn-outline-secondary" type="button" aria-haspopup="true" aria-expanded="false">
|
||||
<button class="btn bg-light" type="button" aria-haspopup="false" aria-expanded="false">
|
||||
%
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@@ -15,5 +15,5 @@
|
||||
</select>
|
||||
|
||||
@if(!defined('LOAD_SELECT2'))
|
||||
@include('load.select2')
|
||||
@include('load.form.select2')
|
||||
@endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
<input type="checkbox" name="{{ $name ?? ''}}" id="{{ $id_name ?? $name ?? '' }}" class="{{ $class ?? 'toggle'}}" value="{{ $val ?? 1}}" data-toggle="toggle" data-on="{{ $on ?? __('yes') }}" data-off="{{ $off ?? __('no') }}" data-onstyle="{{ $onstyle ?? 'outline-success'}}" data-offstyle="{{ $offstyle ?? 'outline-danger'}}" data-size="{{ $size ?? 'sm' }}" @if ( (isset($value) && isset($val) && ($value == $val)) || (!isset($val) && isset($value) && $value)) checked @endif {{ $disabled ?? ''}} {{ $meta ?? ''}} >
|
||||
<input type="hidden" name="{{ $name ?? ''}}" value="0">
|
||||
<input type="checkbox" name="{{ $name ?? ''}}" id="{{ $id_name ?? $name ?? '' }}" class="{{ $class ?? 'toggle'}}" value="{{ $val ?? 1}}" data-toggle="toggle" data-on="{{ $on ?? __('yes') }}" data-off="{{ $off ?? __('no') }}" data-onstyle="{{ $onstyle ?? 'outline-success'}}" data-offstyle="{{ $offstyle ?? 'outline-danger'}}" data-size="{{ $size ?? '' }}" @if ( (isset($value) && isset($val) && ($value == $val)) || (!isset($val) && isset($value) && $value)) checked @endif {{ $disabled ?? ''}} {{ $meta ?? ''}} >
|
||||
|
||||
@include('load.toggle')
|
||||
@include('load.form.toggle')
|
||||
@@ -5,7 +5,7 @@
|
||||
<button class="btn btn-link collapsed" type="button" data-toggle="collapse" data-target="#{{ $id }}" aria-expanded="false" aria-controls="{{ $id }}">
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
</button>
|
||||
{!! $title !!}
|
||||
{!! $title ?? null !!}
|
||||
@if (isset($required) && $required)
|
||||
<sup>*</sup>
|
||||
@endif
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<div class="col row-new-image row-image mt-3 mb-2">
|
||||
<div class="col {{ $prefix ?? '' }}row-new-image row-image mt-3 mb-2">
|
||||
|
||||
<p>
|
||||
<button type="button" class="btn btn-danger delete-new-image-btn"><i class="fa fa-minus-circle"></i></button>
|
||||
Photo <span class="row-image-number"></span>
|
||||
<button type="button" class="btn btn-danger {{ $prefix ?? '' }}delete-new-image-btn"><i class="fa fa-minus-circle"></i></button>
|
||||
Photo <span class="{{ $prefix ?? '' }}row-image-number"></span>
|
||||
</p>
|
||||
|
||||
<input name="images[]" type="file" class="file" data-show-upload="false" data-show-caption="true" data-msg-placeholder="Choisissez une photo">
|
||||
<input name="{{ $prefix ?? '' }}images[]" type="file" class="file" data-show-upload="false" data-show-caption="true" data-msg-placeholder="Choisissez une photo">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -2,19 +2,23 @@
|
||||
@foreach($images as $key => $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"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-outline-danger">
|
||||
<i class="fas fa-trash" data-index="{{ $key }}"></i>
|
||||
</button>
|
||||
</figcaption>
|
||||
@if ($can_edit ?? true)
|
||||
<figcaption class="text-center pt-2">
|
||||
<button type="button" class="btn btn-xs btn-outline-secondary">
|
||||
<i class="fas fa-expand-alt"></i>
|
||||
</button>
|
||||
<button type="button" class="btn btn-xs btn-outline-danger">
|
||||
<i class="fas fa-trash" data-index="{{ $key }}"></i>
|
||||
</button>
|
||||
</figcaption>
|
||||
@endif
|
||||
</figure>
|
||||
@endforeach
|
||||
@endif
|
||||
|
||||
<script>
|
||||
handleDeleteImages();
|
||||
handleEnlargeImages();
|
||||
</script>
|
||||
@if ($can_edit ?? true)
|
||||
<script>
|
||||
{{ $prefix ?? '' }}handleDeleteImages();
|
||||
{{ $prefix ?? '' }}handleEnlargeImages();
|
||||
</script>
|
||||
@endif
|
||||
@@ -1,14 +1,14 @@
|
||||
<div class="row" id="uploader-mini-gallery"></div>
|
||||
<div class="row" id="{{ $prefix ?? '' }}uploader-mini-gallery"></div>
|
||||
|
||||
<div class="modal fade" id="mini-gallery-lightbox" tabindex="-1" role="dialog" aria-labelledby="mini-gallery-lightbox" aria-hidden="true">
|
||||
<div class="modal fade" id="{{ $prefix ?? '' }}mini-gallery-lightbox" tabindex="-1" role="dialog" aria-labelledby="mini-gallery-lightbox" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="mini-gallery-title-lightbox"></h5>
|
||||
<h5 class="modal-title"></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<img src="" id="mini-gallery-img-lightbox" class="img-fluid" >
|
||||
<img src="" class="img-fluid lightbox" >
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -16,8 +16,8 @@
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function handleDeleteImages() {
|
||||
$('#uploader-mini-gallery .fa-trash').click(function() {
|
||||
function {{ $prefix ?? '' }}handleDeleteImages() {
|
||||
$('#{{ $prefix ?? '' }}uploader-mini-gallery .fa-trash').click(function() {
|
||||
id = $('#id').val();
|
||||
index = $(this).data('index');
|
||||
console.log(id);
|
||||
@@ -35,13 +35,13 @@
|
||||
})
|
||||
}
|
||||
|
||||
function handleEnlargeImages() {
|
||||
$('#uploader-mini-gallery .fa-expand-alt').click(function() {
|
||||
function {{ $prefix ?? '' }}handleEnlargeImages() {
|
||||
$('#{{ $prefix ?? '' }}uploader-mini-gallery .fa-expand-alt').click(function() {
|
||||
$img = $(this).parents('figure').find('.img-thumbnail');
|
||||
url = $img.attr('src');
|
||||
console.log(url);
|
||||
$('#mini-gallery-img-lightbox').attr('src', url);
|
||||
$('#mini-gallery-lightbox').modal('show');
|
||||
$('#{{ $prefix ?? '' }}mini-gallery-lightbox .lightbox').attr('src', url);
|
||||
$('#{{ $prefix ?? '' }}mini-gallery-lightbox').modal('show');
|
||||
})
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -2,51 +2,57 @@
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">Photos</h3>
|
||||
<h3 class="card-title">{{ $title }}</h3>
|
||||
<div class="card-tools">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body pt-3 pb-0">
|
||||
@if (isset($id))
|
||||
@if (isset($article['id']))
|
||||
@include('components.uploader.mini-gallery')
|
||||
@endif
|
||||
|
||||
<div id="uploader-new-images"></div>
|
||||
@include('components.uploader.block_image_new', ['name' => 'images[]', 'required' => true])
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-xs btn-primary add-image pull-right">Ajout <i class="fa fa-plus"></i></button>
|
||||
@if ($can_edit ?? true)
|
||||
<div id="{{ $prefix ?? '' }}uploader-new-images"></div>
|
||||
@include('components.uploader.block_image_new', ['name' => 'images[]', 'required' => true])
|
||||
@endif
|
||||
</div>
|
||||
@if ($can_edit ?? true)
|
||||
<div class="card-footer">
|
||||
<button type="button" class="btn btn-xs btn-primary {{ $prefix ?? '' }}add-image pull-right">Ajout <i class="fa fa-plus"></i></button>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function append_image() {
|
||||
$("#uploader-new-images .file").fileinput();
|
||||
$("#uploader-new-images .file").focus();
|
||||
function {{ $prefix ?? '' }}append_image() {
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images .file").fileinput();
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images .file").focus();
|
||||
}
|
||||
|
||||
$("#uploader-new-images").appender({
|
||||
rowSection: '.row-new-image',
|
||||
type: '.row-image',
|
||||
addBtn: '.add-image',
|
||||
$("#{{ $prefix ?? '' }}uploader-new-images").appender({
|
||||
rowSection: '.{{ $prefix ?? '' }}row-new-image',
|
||||
type: '.{{ $prefix ?? '' }}row-image',
|
||||
addBtn: '.{{ $prefix ?? '' }}add-image',
|
||||
appendEffect: 'fade',
|
||||
addClass: 'animated fadeIn',
|
||||
rowNumber: '.row-image-number',
|
||||
deleteBtn: '.delete-new-image-btn',
|
||||
callback: append_image,
|
||||
rowNumber: '.{{ $prefix ?? '' }}row-image-number',
|
||||
deleteBtn: '.{{ $prefix ?? '' }}delete-new-image-btn',
|
||||
callback: {{ $prefix ?? '' }}append_image,
|
||||
hideSection: true
|
||||
});
|
||||
|
||||
function loadImages()
|
||||
{
|
||||
$gallery = $("#uploader-mini-gallery");
|
||||
$gallery = $("#{{ $prefix ?? '' }}uploader-mini-gallery");
|
||||
if ($gallery) {
|
||||
$gallery.load("{{ $load_url }}");
|
||||
}
|
||||
}
|
||||
|
||||
loadImages();
|
||||
$(function() {
|
||||
loadImages();
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
|
||||
Reference in New Issue
Block a user