diff --git a/resources/views/layouts/block.blade.php b/resources/views/layouts/block.blade.php index 1be750a8a3..6a0cfbef80 100644 --- a/resources/views/layouts/block.blade.php +++ b/resources/views/layouts/block.blade.php @@ -1,20 +1,29 @@
@if(!empty($title) || !empty($description)) -
- - {{ __($title ?? '') }} +
+ + {{ __($title ?? '') }} - @if(!empty($description)) -

- {!! __($description ?? '') !!} -

- @endif -
-
+ @if(!empty($description)) +

+ {!! __($description ?? '') !!} +

+ @endif +
+
@endif
+ @if($commandBar && $topCommandBar) +
+ @foreach($commandBar as $command) +
+ {!! $command !!} +
+ @endforeach +
+ @endif -
+
@foreach($manyForms as $key => $layouts) @foreach($layouts as $layout) {!! $layout ?? '' !!} @@ -22,7 +31,7 @@ @endforeach
- @empty(!$commandBar) + @if($commandBar && !$topCommandBar)
@foreach($commandBar as $command)
@@ -30,7 +39,7 @@
@endforeach
- @endempty + @endif
diff --git a/src/Screen/Layouts/Block.php b/src/Screen/Layouts/Block.php index 3ff454cd63..0103a13f3f 100644 --- a/src/Screen/Layouts/Block.php +++ b/src/Screen/Layouts/Block.php @@ -27,6 +27,7 @@ abstract class Block extends Layout */ protected $variables = [ 'vertical' => false, + 'topCommandBar' => false, ]; /** @@ -98,11 +99,14 @@ public function vertical($vertical = true): self return $this; } + /** * @param Action|Action[] description */ - public function commands($commands): self + public function commands($commands, $top = false): self { + $this->variables['topCommandBar'] = $top; + $this->commandBar = Arr::wrap($commands); return $this;