]> _ Git - cubist_cms-back.git/commitdiff
#2783
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jun 2019 12:58:23 +0000 (14:58 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Fri, 7 Jun 2019 12:58:23 +0000 (14:58 +0200)
src/app/Magic/Fields/Field.php
src/app/Magic/Fields/Range.php
src/resources/views/fields/rangeofvalues.blade.php [new file with mode: 0644]

index a3b55ddcef37db90cc5830d04bcf2bcc37535b40..a1c50722e0e6f6d3d92e1b10db4f6f17fc65fc7f 100644 (file)
@@ -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,
index 16d036c3cc51ad23660f857c09e0c7032bab66de..8715bbc0b9794ad3270649d0112ad3b3b684ee56 100644 (file)
@@ -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 (file)
index 0000000..8157434
--- /dev/null
@@ -0,0 +1,35 @@
+<!-- field_type_name -->
+<div @include('crud::inc.field_wrapper_attributes') >
+    <label>{!! $field['label'] !!}</label>
+    <div @include('crud::inc.field_attributes')>
+        <input
+            type="text"
+            name="{{ $field['name'] }}[min]"
+        >
+        <input
+            type="text"
+            name="{{ $field['name'] }}[max]"
+        >
+    </div>
+
+    {{-- HINT --}}
+    @if (isset($field['hint']))
+        <p class="help-block">{!! $field['hint'] !!}</p>
+    @endif
+</div>
+
+@if ($crud->checkIfFieldIsFirstOfItsType($field))
+    {{-- FIELD EXTRA CSS  --}}
+    {{-- push things in the after_styles section --}}
+
+    @push('crud_fields_styles')
+        <!-- no styles -->
+    @endpush
+
+    {{-- FIELD EXTRA JS --}}
+    {{-- push things in the after_scripts section --}}
+
+    @push('crud_fields_scripts')
+        <!-- no scripts -->
+    @endpush
+@endif