]> _ Git - cubist_cms-back.git/commitdiff
wip #5041 @1
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 8 Feb 2022 19:07:47 +0000 (20:07 +0100)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Tue, 8 Feb 2022 19:07:47 +0000 (20:07 +0100)
src/app/Magic/Fields/Files.php
src/public/bunchmultiple/bunchmultiple.js
src/resources/views/fields/dropzone_media.blade.php

index 1b926c5ca49351df580a5577e70c10172d20b55d..85eb2d9682596c67a14ccc051002d97147c8aed5 100644 (file)
@@ -51,7 +51,6 @@ class Files extends Field
         if (is_array($accepted)) {
             $this->setAttribute('options.acceptedFiles', implode(',', $accepted));
         }
-
     }
 
     protected function _getAttributesAliases()
index c10b8a0836cdae7e7977ecc3ee0fa8b4d42e0662..dd53a0133276f8efff8bf2547500812f0cbe18f0 100644 (file)
                 var item = $(this).closest('.item');
                 var form = item.find('.subform');
                 var txt = $(this).data('legend').replace(/\%([a-zA-Z0-9_]+)/gm, function (match, varname) {
-                    return form.find('[name="' + varname + '"]').val();
+
+                    var input = form.find('[name="' + varname + '"]');
+
+                    if (input.length === 0) {
+                        input = form.find('[name="' + form.data('bmid') + '___' + varname + '"]');
+                        console.log(input);
+                    }
+                    var res = $(input).val();
+
+                    return res;
                 });
                 $(this).text(txt);
             });
index c516cb3db14ede8064b6db7f38ea35285a823fc3..768f07a7c11b78967b180981e509bd16770fb70c 100644 (file)
@@ -3,17 +3,17 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ??
 
 ?>
 @if(isset($entry))
-    <div class="form-group col-md-12">
-        <strong>{{ $field['label'] }}</strong> <br>
-        <input type="hidden" value="{{$collection}}" name="{{$field['name']}}"/>
-        <div data-url="{{ url($crud->route . '/' . $entry->id . '/media') }}"
-             data-options='@json($field['options'])'
-             class="dropzone dz-clickable sortable">
-            <div class="dz-message">
-                {{__('Drop files here or click to upload')}}
-            </div>
+    @include('crud::fields.inc.wrapper_start')
+    <strong>{{ $field['label'] }}</strong> <br>
+    <input type="hidden" value="{{$collection}}" name="{{$field['name']}}"/>
+    <div data-url="{{ url($crud->route . '/' . $entry->id . '/media') }}"
+         data-options='@json($field['options'])'
+         class="dropzone dz-clickable sortable">
+        <div class="dz-message">
+            {{__('Drop files here or click to upload')}}
         </div>
     </div>
+    @include('crud::fields.inc.wrapper_end')
 
     {{-- ########################################## --}}
     {{-- Extra CSS and JS for this particular field --}}
@@ -226,7 +226,7 @@ $collection = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ??
                             }
                         });
                     }
-                    
+
                     function initOneDropzone(el) {
                         el = $(el);
                         var base_url = el.data('url');