From 3077bd60c384e066dc239824ee5e056f9672294b Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Fri, 14 Jun 2019 15:28:26 +0200 Subject: [PATCH] wip #2835 @1 --- src/app/Magic/Fields/Field.php | 2 +- src/app/Magic/Fields/Tags.php | 12 ++++ src/resources/views/fields/tags.blade.php | 71 +++++++++++++++++++++++ 3 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 src/app/Magic/Fields/Tags.php create mode 100644 src/resources/views/fields/tags.blade.php diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index 49e7737..6e9225b 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -88,7 +88,7 @@ class Field if (class_exists(__NAMESPACE__ . '\\' . $type)) { return __NAMESPACE__ . '\\' . $type; } - return self::class; + throw new Exception('Field ' . $type . ' not available'); } public function getDefaultAttributes() diff --git a/src/app/Magic/Fields/Tags.php b/src/app/Magic/Fields/Tags.php new file mode 100644 index 0000000..0f73d1c --- /dev/null +++ b/src/app/Magic/Fields/Tags.php @@ -0,0 +1,12 @@ + +
+ + @include('crud::inc.field_translatable_icon') + + + @if(isset($field['select_all']) && $field['select_all']) + {{ trans('backpack::crud.select_all') }} + {{ trans('backpack::crud.clear') }} + @endif + + {{-- 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