From 91f89f8a07eb091dce03b884258b7b173bac19b9 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 28 Jun 2019 11:58:07 +0200 Subject: [PATCH] #2843 --- src/app/Magic/Fields/SelectFromModel.php | 1 + .../views/fields/dropzone_media.blade.php | 2 - .../views/fields/select2_from_array.blade.php | 94 +++++++++++++++++++ 3 files changed, 95 insertions(+), 2 deletions(-) create mode 100644 src/resources/views/fields/select2_from_array.blade.php diff --git a/src/app/Magic/Fields/SelectFromModel.php b/src/app/Magic/Fields/SelectFromModel.php index e5a77f4..1042893 100644 --- a/src/app/Magic/Fields/SelectFromModel.php +++ b/src/app/Magic/Fields/SelectFromModel.php @@ -9,6 +9,7 @@ use Cubist\Backpack\CubistBackpackServiceProvider; class SelectFromModel extends Model { protected $_adminType = 'select2_from_array'; + protected $_viewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::fields'; protected $_columnViewNamespace = CubistBackpackServiceProvider::NAMESPACE . '::columns'; protected $_columnType = 'select_from_array'; diff --git a/src/resources/views/fields/dropzone_media.blade.php b/src/resources/views/fields/dropzone_media.blade.php index 213106b..f75a599 100644 --- a/src/resources/views/fields/dropzone_media.blade.php +++ b/src/resources/views/fields/dropzone_media.blade.php @@ -168,11 +168,9 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? if (files === undefined) { files = []; } - console.log(collection, files); for (var i = 0; i < files.length; i++) { var file = files[i]; - console.log(file); this.emit('addedfile', file); diff --git a/src/resources/views/fields/select2_from_array.blade.php b/src/resources/views/fields/select2_from_array.blade.php new file mode 100644 index 0000000..8624cb7 --- /dev/null +++ b/src/resources/views/fields/select2_from_array.blade.php @@ -0,0 +1,94 @@ + +
+ + + + {{-- HINT --}} + @if (isset($field['hint'])) +

{!! $field['hint'] !!}

+ @endif +
+ +{{-- ########################################## --}} +{{-- Extra CSS and JS for this particular field --}} +{{-- If a field type is shown multiple times on a form, the CSS and JS will only be loaded once --}} +@if ($crud->checkIfFieldIsFirstOfItsType($field)) + + {{-- FIELD CSS - will be loaded in the after_styles section --}} + @push('crud_fields_styles') + + + + @endpush + + {{-- FIELD JS - will be loaded in the after_scripts section --}} + @push('crud_fields_scripts') + + + + @endpush + +@endif +{{-- End of Extra CSS and JS --}} +{{-- ########################################## --}} -- 2.39.5