Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 22 additions & 13 deletions resources/views/layouts/block.blade.php
Original file line number Diff line number Diff line change
@@ -1,36 +1,45 @@
<fieldset class="row g-0 mb-3">
@if(!empty($title) || !empty($description))
<div class="col p-0 px-3">
<legend class="text-body-emphasis px-2 mt-2">
{{ __($title ?? '') }}
<div class="col p-0 px-3">
<legend class="text-body-emphasis px-2 mt-2">
{{ __($title ?? '') }}

@if(!empty($description))
<p class="small text-muted mt-2 mb-0 text-balance">
{!! __($description ?? '') !!}
</p>
@endif
</legend>
</div>
@if(!empty($description))
<p class="small text-muted mt-2 mb-0 text-balance">
{!! __($description ?? '') !!}
</p>
@endif
</legend>
</div>
@endif
<div class="col-12 {{!$vertical ? 'col-md-7' : ''}} shadow-sm h-100">
@if($commandBar && $topCommandBar)
<div class="bg-light px-4 py-3 d-flex justify-content-end rounded-top gap-2">
@foreach($commandBar as $command)
<div>
{!! $command !!}
</div>
@endforeach
</div>
@endif

<div class="bg-white d-flex flex-column layout-wrapper {{ empty($commandBar) ? 'rounded' : 'rounded-top' }}">
<div class="bg-white d-flex flex-column layout-wrapper {{ empty($commandBar) ? 'rounded' : ($topCommandBar ? 'rounded-bottom' : 'rounded-top') }}">
@foreach($manyForms as $key => $layouts)
@foreach($layouts as $layout)
{!! $layout ?? '' !!}
@endforeach
@endforeach
</div>

@empty(!$commandBar)
@if($commandBar && !$topCommandBar)
<div class="bg-light px-4 py-3 d-flex justify-content-end rounded-bottom gap-2">
@foreach($commandBar as $command)
<div>
{!! $command !!}
</div>
@endforeach
</div>
@endempty
@endif
</div>
</fieldset>

6 changes: 5 additions & 1 deletion src/Screen/Layouts/Block.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ abstract class Block extends Layout
*/
protected $variables = [
'vertical' => false,
'topCommandBar' => false,
];

/**
Expand Down Expand Up @@ -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;
Expand Down
Loading