]> _ Git - cubist_cms-back.git/commitdiff
wip #5944 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 May 2023 09:33:29 +0000 (11:33 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 24 May 2023 09:33:29 +0000 (11:33 +0200)
src/app/Magic/Fields/Field.php
src/resources/views/fields/noteditable.blade.php

index b46ef69796e483192aef738bc25454dbee8a7bc7..e9d501964522c074e297852cafc0547ea9cddbdb 100644 (file)
@@ -418,8 +418,9 @@ class Field implements \ArrayAccess
                 $this->setAttribute('auth', false);
                 $this->setAttribute('type', 'noteditable');
                 $this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
-                $this->setAttribute('tab',null);
-                $this->setAttribute('label','');
+                $this->setAttribute('tab', null);
+                $this->setAttribute('label', '');
+                $this->setAttribute('read_only', false);
             }
         } else if (null !== $this->getAttribute('can_hidden', null)) {
             if (!self::can($this->getAttribute('can_hidden'))) {
@@ -429,8 +430,9 @@ class Field implements \ArrayAccess
                 $this->setAttribute('auth', false);
                 $this->setAttribute('type', 'authhidden');
                 $this->setAttribute('view_namespace', CubistBackpackServiceProvider::NAMESPACE . '::fields');
-                $this->setAttribute('tab',null);
-                $this->setAttribute('label','');
+                $this->setAttribute('tab', null);
+                $this->setAttribute('label', '');
+                $this->setAttribute('read_only', false);
             }
         }
 
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..059e528790f490b7109b3c452a989aeae450330b 100644 (file)
@@ -0,0 +1,21 @@
+@push('crud_fields_scripts')
+    @loadOnce('bpFieldInitNotEditable')
+    <script>
+        $(function () {
+            var isCardVisible = false;
+            $('.card').each(function () {
+                $('.card-body').each(function () {
+                    if ($(this).children(':not(.hidden)').length > 0) {
+                        isCardVisible = true;
+                    } else {
+                        $(this).hide();
+                    }
+                });
+                if (!isCardVisible) {
+                    $(this).hide();
+                }
+            });
+        });
+    </script>
+    @endLoadOnce
+@endpush