From: Vincent Vanwaelscappel Date: Fri, 7 Jun 2019 12:58:23 +0000 (+0200) Subject: #2783 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=1f9bb47d734f94738120d3d29c1884b8d297199f;p=cubist_cms-back.git #2783 --- diff --git a/src/app/Magic/Fields/Field.php b/src/app/Magic/Fields/Field.php index a3b55dd..a1c5072 100644 --- a/src/app/Magic/Fields/Field.php +++ b/src/app/Magic/Fields/Field.php @@ -21,6 +21,7 @@ class Field protected $_databaseUnique = false; protected $_databaseIndex = false; protected $_translatable = false; + protected $_viewNamespace = 'crud::fields'; protected $_databaseAttributes = []; @@ -64,7 +65,7 @@ class Field public function getDefaultAttributes() { - return ['type' => $this->_adminType, 'column' => false, 'form' => 'both', 'rules' => '', + return ['type' => $this->_adminType, 'view_namespace' => $this->_viewNamespace, 'column' => false, 'form' => 'both', 'rules' => '', 'fillable' => true, 'guarded' => false, 'hidden' => false, 'translatable' => $this->_translatable, 'column_type' => $this->_columnType, 'default' => '', 'cast' => $this->_cast, 'allow_null' => true, diff --git a/src/app/Magic/Fields/Range.php b/src/app/Magic/Fields/Range.php index 16d036c..8715bbc 100644 --- a/src/app/Magic/Fields/Range.php +++ b/src/app/Magic/Fields/Range.php @@ -4,8 +4,8 @@ namespace Cubist\Backpack\app\Magic\Fields; - class Range extends Field { - protected $_adminType = 'range'; + protected $_adminType = 'rangeofvalues'; + protected $_viewNamespace = 'cubist_back::fields'; } diff --git a/src/resources/views/fields/rangeofvalues.blade.php b/src/resources/views/fields/rangeofvalues.blade.php new file mode 100644 index 0000000..8157434 --- /dev/null +++ b/src/resources/views/fields/rangeofvalues.blade.php @@ -0,0 +1,35 @@ + +
+ +
+ + +
+ + {{-- HINT --}} + @if (isset($field['hint'])) +

{!! $field['hint'] !!}

+ @endif +
+ +@if ($crud->checkIfFieldIsFirstOfItsType($field)) + {{-- FIELD EXTRA CSS --}} + {{-- push things in the after_styles section --}} + + @push('crud_fields_styles') + + @endpush + + {{-- FIELD EXTRA JS --}} + {{-- push things in the after_scripts section --}} + + @push('crud_fields_scripts') + + @endpush +@endif