From: Vincent Vanwaelscappel Date: Fri, 7 Jun 2019 15:06:37 +0000 (+0200) Subject: #2810 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ae8b6bda972769c18e6eaa979d45c3d36f39e980;p=cubist_cms-back.git #2810 --- diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index 58f8246..03232e3 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -27,7 +27,7 @@ class Field protected $_translatable = false; protected $_databaseAttributes = []; - + /** * @param $attributes * @return Field @@ -158,9 +158,9 @@ class Field $this->setAttributeIfNotSet('store_in', 'extras'); } if ($this->hasAttribute('when')) { - $htmlAttributes = $this->getAttribute('attributes', []); - $htmlAttributes['data-when'] = json_encode($this->getAttribute('when')); - $this->setAttribute('attributes', $htmlAttributes); + $wrapperAttributes = $this->getAttribute('wrapperAttributes', []); + $wrapperAttributes['data-when'] = json_encode($this->getAttribute('when')); + $this->setAttribute('wrapperAttributes', $wrapperAttributes); } } } diff --git a/src/resources/views/fields/rangeofvalues.blade.php b/src/resources/views/fields/rangeofvalues.blade.php index 860bfd7..745adbf 100644 --- a/src/resources/views/fields/rangeofvalues.blade.php +++ b/src/resources/views/fields/rangeofvalues.blade.php @@ -1,20 +1,54 @@ + '', 'second' => '']; +$value = old(square_brackets_to_dots($field['name'])) ?? $field['value'] ?? $field['default'] ?? $empty; +if ($value == '') { + $value = $empty; +} +if (!isset($value['first'])) { + $value['first'] = ''; +} +if (!isset($value['second'])) { + $value['second'] = ''; +} + + +?>
- + @if(isset($field['prefix']) || isset($field['suffix'])) +
@endif + @if(isset($field['prefix'])) +
{!! $field['prefix'] !!}
@endif + + @if(isset($field['suffix'])) +
{!! $field['suffix'] !!}
@endif + + @if(isset($field['prefix']) || isset($field['suffix']))
@endif
- + @if(isset($field['prefix']) || isset($field['suffix'])) +
@endif + @if(isset($field['prefix'])) +
{!! $field['prefix'] !!}
@endif + + + @if(isset($field['suffix'])) +
{!! $field['suffix'] !!}
@endif + + @if(isset($field['prefix']) || isset($field['suffix']))
@endif
@@ -42,7 +76,7 @@ box-sizing: border-box; } - .rangeofvalues__field label{ + .rangeofvalues__field label { font-weight: 400; }