]> _ Git - cubist_cms-back.git/commitdiff
wip #4626 @0.5
authorVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Jul 2021 16:38:09 +0000 (18:38 +0200)
committerVincent Vanwaelscappel <vincent@cubedesigners.com>
Wed, 28 Jul 2021 16:38:09 +0000 (18:38 +0200)
src/app/Magic/Models/CubistMagicAbstractModel.php
src/resources/views/form/shortcuts.blade.php

index 03db139d884a466fc9462526a6e55cd34305d574..e73f1e1cc13c3eb0e14915d5465950cb70d2eea6 100644 (file)
@@ -87,8 +87,16 @@ class CubistMagicAbstractModel extends Model implements HasMedia
      */
     protected $fakeColumns = [];
 
+    /**
+     * @var array
+     */
     protected $additionalEditViews = [];
 
+    /**
+     * @var array
+     */
+    protected $editActions = [];
+
 
     /**
      * @var array
@@ -888,6 +896,16 @@ class CubistMagicAbstractModel extends Model implements HasMedia
         $this->additionalEditViews[] = $view;
     }
 
+    public function addEditAction($view)
+    {
+        $this->editActions[] = $view;
+    }
+
+    public function getEditActions()
+    {
+        return $this->editActions;
+    }
+
     public function preCache()
     {
         foreach ($this->getFields() as $field) {
index 8b9406a5f476fd10b5bdf62ce6a59e0ac0b05c82..18a5977f1f8f3b89e5c6d9556304314498f915aa 100644 (file)
@@ -3,36 +3,45 @@
 @endsection
 <div class="col-md-4">
     <div id="form_sidebar">
-    @hasSection('form_shortcut_m')
-        <style type="text/css">
-            #form_sidebar {
-                position: sticky;
-                top: 30px;
-            }
+        @hasSection('form_shortcut_m')
+            <style type="text/css">
+                #form_sidebar {
+                    position: sticky;
+                    top: 30px;
+                }
 
-            #form_shortcuts .card {
-                padding: 30px;
-            }
+                #form_shortcuts .card {
+                    padding: 30px;
+                }
 
-            #form_shortcuts a {
-                display: block;
-                font-size: 120%;
-                font-weight: 500;
-            }
-        </style>
+                #form_shortcuts a {
+                    display: block;
+                    font-size: 120%;
+                    font-weight: 500;
+                }
+            </style>
 
-        <aside id="form_shortcuts">
-            <div class="card">
-                <nav>
-                    @yield('form_shortcut_m')
-                </nav>
-            </div>
-        </aside>
+            <aside id="form_shortcuts">
+                <div class="card">
+                    <nav>
+                        @yield('form_shortcut_m')
+                    </nav>
+                </div>
+            </aside>
+            @push('after_scripts')
+                <script>
+                    (function ($) {
+                        $(function () {
+                            $("#saveActions .btn-form-cancel").remove();
+                            $("#saveActions").insertBefore('#form_shortcuts');
+                        });
+                    })(jQuery);
+                </script>
+            @endpush
+        @endif
 
-    @endif
-
-    @hasSection('form_below_shortcuts')
-        @yield('form_below_shortcuts')
-    @endif
+        @hasSection('form_below_shortcuts')
+            @yield('form_below_shortcuts')
+        @endif
     </div>
 </div>