diff --git a/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php b/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php index afb9e0579e..685d400bec 100644 --- a/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php +++ b/app/Http/Livewire/CustomFieldSetDefaultValuesForModel.php @@ -36,9 +36,6 @@ class CustomFieldSetDefaultValuesForModel extends Component public function render() { // return 'fart
Hi: {{ $this->add_default_values }} yeah?
'; - if($this->fieldset_id) { - $this->fields = CustomFieldset::find($this->fieldset_id)->fields()->get(); - } return view('livewire.custom-field-set-default-values-for-model'); } } diff --git a/app/Http/Livewire/CustomFieldsForFieldset.php b/app/Http/Livewire/CustomFieldsForFieldset.php new file mode 100644 index 0000000000..46d302c396 --- /dev/null +++ b/app/Http/Livewire/CustomFieldsForFieldset.php @@ -0,0 +1,21 @@ +fieldset_id) { + $this->fields = CustomFieldset::find($this->fieldset_id)->fields()->get(); + } + return view('livewire.custom-fields-for-fieldset'); + } +} diff --git a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php index 7c08547548..c5acfbaea9 100644 --- a/resources/views/livewire/custom-field-set-default-values-for-model.blade.php +++ b/resources/views/livewire/custom-field-set-default-values-for-model.blade.php @@ -17,39 +17,7 @@
Default Values -
- @empty($fields) {{-- There was an error? --}} -

- There was a problem retrieving the fields for this fieldset. -

- @else - {{-- NOTE: This stuff could work well also for the 'view this asset and do its custom fields' thing --}} - @foreach($fields as $field) -
-
- -
-
- @if($field->element == "text") - - @elseif($field->element == "textarea") -
- @elseif($field->element == "listbox") - - - @else - Unknonown field element: {{ $field->element }} - @endif -
-
- @endforeach - @endif -
+ @livewire('custom-fields-for-fieldset',['fieldset_id' => $fieldset_id])
diff --git a/resources/views/livewire/custom-fields-for-fieldset.blade.php b/resources/views/livewire/custom-fields-for-fieldset.blade.php new file mode 100644 index 0000000000..7f16537734 --- /dev/null +++ b/resources/views/livewire/custom-fields-for-fieldset.blade.php @@ -0,0 +1,34 @@ +
+ @empty($fields) {{-- There was an error? --}} +

+ There was a problem retrieving the fields for this fieldset. +

+ @else + {{-- NOTE: This stuff could work well also for the 'view this asset and do its custom fields' thing --}} + {{-- I don't know if we break *here* or if we break per field element? --}} + @foreach($fields as $field) +
+
+ +
+
+ @if($field->element == "text") + + @elseif($field->element == "textarea") +
+ @elseif($field->element == "listbox") + + + @else + Unknonown field element: {{ $field->element }} + @endif +
+
+ @endforeach + @endif +
diff --git a/resources/views/models/edit.blade.php b/resources/views/models/edit.blade.php index 898df8fec1..c3df06f09e 100755 --- a/resources/views/models/edit.blade.php +++ b/resources/views/models/edit.blade.php @@ -82,10 +82,10 @@ @stop -@section('moar_scripts') +{{-- @section('moar_scripts') -@endsection +@endsection --}}