summaryrefslogtreecommitdiff
path: root/resources
diff options
context:
space:
mode:
authorSam Light <samlight1994@gmail.com>2023-11-16 01:31:50 +0000
committerSam Light <samlight1994@gmail.com>2023-11-16 01:31:50 +0000
commit3c33b9201ee02d8b73986e489b9637d2875413de (patch)
treefd0380332c9a5335314df5a8b9ad87f7223a9b80 /resources
parentd8d11445460a1a9e35c39937772d789036286fdf (diff)
Updated hiding header section only show if something should be shown
Diffstat (limited to 'resources')
-rw-r--r--resources/views/table.blade.php60
1 files changed, 31 insertions, 29 deletions
diff --git a/resources/views/table.blade.php b/resources/views/table.blade.php
index 5f6df75..3ee29ab 100644
--- a/resources/views/table.blade.php
+++ b/resources/views/table.blade.php
@@ -1,40 +1,42 @@
<div>
- <div class="table-controls pb-2 d-flex justify-content-between align-items-center">
- @if($searchable)
- <div>
- <input class="form-control border-secondary" type="search"
- wire:model.live.debounce.{{ $searchDebounce}}="search"
- placeholder="{{ __('Search') }}..." />
- </div>
- @endif
- <div class="d-flex gap-3">
- @if($showColumnSelect)
- <div class="dropdown">
- <button type="button" class="btn btn-outline-secondary border-secondary"
- data-bs-toggle="dropdown" aria-expanded="false"
- data-bs-auto-close="outside">
- {{ __('Columns') }}
- </button>
- <div class="dropdown-menu p-4">
- @foreach($allColumns->filter(fn($c) => $c->getShowInSelect()) as $column)
+ @if($searchable || $showColumnSelect || $showPageSizeSelect)
+ <div class="table-controls pb-2 d-flex justify-content-between align-items-center">
+ @if($searchable)
+ <div>
+ <input class="form-control border-secondary" type="search"
+ wire:model.live.debounce.{{ $searchDebounce}}="search"
+ placeholder="{{ __('Search') }}..." />
+ </div>
+ @endif
+ <div class="d-flex gap-3">
+ @if($showColumnSelect)
+ <div class="dropdown">
+ <button type="button" class="btn btn-outline-secondary border-secondary"
+ data-bs-toggle="dropdown" aria-expanded="false"
+ data-bs-auto-close="outside">
+ {{ __('Columns') }}
+ </button>
+ <div class="dropdown-menu p-4">
+ @foreach($allColumns->filter(fn($c) => $c->getShowInSelect()) as $column)
<label class="d-block">
<input type="checkbox" wire:model.live="activeColumns"
value="{{ $column->name }}" />
{{ $column->title }}
</label>
- @endforeach
+ @endforeach
+ </div>
</div>
- </div>
- @endif
- @if($showPageSizeSelect)
- <select wire:model.live="pageSize" class="form-select border-secondary">
- @foreach($pageSizes as $size)
- <option value="{{ $size }}">{{ $size }}</option>
- @endforeach
- </select>
- @endif
+ @endif
+ @if($showPageSizeSelect)
+ <select wire:model.live="pageSize" class="form-select border-secondary">
+ @foreach($pageSizes as $size)
+ <option value="{{ $size }}">{{ $size }}</option>
+ @endforeach
+ </select>
+ @endif
+ </div>
</div>
- </div>
+ @endif
<table class="table">
<thead>
<tr>