<!-- Bunch -->
<?php
+$empty = [];
+$value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? $empty;
+if ($value == '') {
+ $value = $empty;
+}
+
+if (is_string($value)) {
+ $value = json_decode($value, true);
+}
+
+foreach ($value as $k => $v) {
+ $ik=$field['name'].'___'.$k;
+ if (isset($field['bunchfields'][$ik])) {
+ $field['bunchfields'][$ik]['value'] = $v;
+ }
+}
?>
-<div class="bunch__wrapper col-xs-12">
- <div @include('crud::inc.field_wrapper_attributes') >
- <label>{!! $field['label'] !!}</label>
- @include('crud::inc.field_translatable_icon')
- <div class="clearfix"></div>
+<div class="bunch__margin col-xs-12">
+ <div class="bunch__wrapper col-xs-12">
+ <div @include('crud::inc.field_wrapper_attributes') >
+ <label>{!! $field['label'] !!}</label>
+ @include('crud::inc.field_translatable_icon')
+ <div class="clearfix"></div>
- @include('cubist_back::inc.show_bunch_fields', array('bunchfields'=>$field['bunchfields']))
+ @include('cubist_back::inc.show_bunch_fields', array('bunchfields'=>$field['bunchfields']))
- <div class="clearfix"></div>
+ <div class="clearfix"></div>
- {{-- HINT --}}
- @if (isset($field['hint']))
- <p class="help-block">{!! $field['hint'] !!}</p>
- @endif
+ {{-- HINT --}}
+ @if (isset($field['hint']))
+ <p class="help-block">{!! $field['hint'] !!}</p>
+ @endif
+ </div>
</div>
</div>
{{-- FIELD CSS - will be loaded in the after_styles section --}}
@push('crud_fields_styles')
<style type="text/css">
+
+ .bunch__margin {
+ margin: 0;
+ }
+
.bunch__wrapper {
padding: 15px;
border: 1px solid #eee;
background: #fafafa;
margin-bottom: 15px;
}
- .bunch__wrapper .form-group{
+
+ .bunch__wrapper .form-group {
padding: 0;
}
- .bunch__wrapper > .form-group > label{
+ .bunch__wrapper > .form-group > label {
font-size: 1.2em;
margin-bottom: 24px;
}