From c3366a0b96e73e2815ac12670cec594a45086530 Mon Sep 17 00:00:00 2001 From: andreazanini Date: Tue, 10 Jan 2023 17:59:18 +0100 Subject: [PATCH 1/4] first test --- resources/views/components/empty.blade.php | 3 +++ resources/views/grid-view/grid-view.blade.php | 8 ++++++-- resources/views/list-view/list-view.blade.php | 5 +++++ resources/views/table-view/table-view.blade.php | 4 +--- src/Views/DetailView.php | 2 ++ 5 files changed, 17 insertions(+), 5 deletions(-) create mode 100644 resources/views/components/empty.blade.php diff --git a/resources/views/components/empty.blade.php b/resources/views/components/empty.blade.php new file mode 100644 index 0000000..0c6e768 --- /dev/null +++ b/resources/views/components/empty.blade.php @@ -0,0 +1,3 @@ +
+

{{ __('There are no items in this table') }}

+
\ No newline at end of file diff --git a/resources/views/grid-view/grid-view.blade.php b/resources/views/grid-view/grid-view.blade.php index 7f2e708..2eb7872 100644 --- a/resources/views/grid-view/grid-view.blade.php +++ b/resources/views/grid-view/grid-view.blade.php @@ -28,7 +28,7 @@
@include('laravel-views::components.toolbar.toolbar')
- + @if (count($items))
@foreach ($items as $item)
@@ -49,8 +49,12 @@ />
@endforeach +
- +@else + {{-- Empty data message --}} + + @endif {{-- Paginator, loading indicator and totals --}}
{{ $items->links() }} diff --git a/resources/views/list-view/list-view.blade.php b/resources/views/list-view/list-view.blade.php index 8047981..0777c33 100644 --- a/resources/views/list-view/list-view.blade.php +++ b/resources/views/list-view/list-view.blade.php @@ -5,6 +5,7 @@
+ @if (count($items)) @foreach ($items as $item)
@if ($this->hasBulkActions) @@ -17,6 +18,10 @@
@endforeach + @else + {{-- Empty data message --}} + + @endif {{-- Paginator, loading indicator and totals --}} diff --git a/resources/views/table-view/table-view.blade.php b/resources/views/table-view/table-view.blade.php index f4cf9ee..8a43669 100644 --- a/resources/views/table-view/table-view.blade.php +++ b/resources/views/table-view/table-view.blade.php @@ -25,9 +25,7 @@ @else {{-- Empty data message --}} -
-

{{ __('There are no items in this table') }}

-
+ @endif {{-- Paginator, loading indicator and totals --}} diff --git a/src/Views/DetailView.php b/src/Views/DetailView.php index d42c806..865fccb 100644 --- a/src/Views/DetailView.php +++ b/src/Views/DetailView.php @@ -14,6 +14,8 @@ class DetailView extends View protected $view = 'detail-view.detail-view'; protected $modelClass; protected $detailComponent = null; + public $emptyComponent = 'laravel-views::components.empty'; + public $title = ''; public $subtitle = ''; From f72d87f95379fdcb61384529abab1da34cb82fee Mon Sep 17 00:00:00 2001 From: andreazanini <93669027+andreazanini@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:08:29 +0100 Subject: [PATCH 2/4] Update DetailView.php --- src/Views/DetailView.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Views/DetailView.php b/src/Views/DetailView.php index 865fccb..d42c806 100644 --- a/src/Views/DetailView.php +++ b/src/Views/DetailView.php @@ -14,8 +14,6 @@ class DetailView extends View protected $view = 'detail-view.detail-view'; protected $modelClass; protected $detailComponent = null; - public $emptyComponent = 'laravel-views::components.empty'; - public $title = ''; public $subtitle = ''; From d68982328e4db4a58701672da022e35e91b1f97e Mon Sep 17 00:00:00 2001 From: andreazanini <93669027+andreazanini@users.noreply.github.com> Date: Fri, 3 Feb 2023 17:08:52 +0100 Subject: [PATCH 3/4] Update DataView.php --- src/Views/DataView.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Views/DataView.php b/src/Views/DataView.php index 66508f1..e9e9767 100644 --- a/src/Views/DataView.php +++ b/src/Views/DataView.php @@ -47,6 +47,8 @@ abstract class DataView extends View public $selected = []; public $allSelected = false; + + public $emptyComponent = 'laravel-views::components.empty'; public function hydrate() { From 4c8cfeb3044cf7c259575a35f00fb8b9e001f715 Mon Sep 17 00:00:00 2001 From: andreazanini Date: Thu, 9 Feb 2023 18:27:40 +0100 Subject: [PATCH 4/4] missing data --- resources/views/grid-view/grid-view.blade.php | 2 +- resources/views/list-view/list-view.blade.php | 2 +- resources/views/table-view/table-view.blade.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/views/grid-view/grid-view.blade.php b/resources/views/grid-view/grid-view.blade.php index 2eb7872..0e91a2c 100644 --- a/resources/views/grid-view/grid-view.blade.php +++ b/resources/views/grid-view/grid-view.blade.php @@ -53,7 +53,7 @@ @else {{-- Empty data message --}} - + @endif {{-- Paginator, loading indicator and totals --}}
diff --git a/resources/views/list-view/list-view.blade.php b/resources/views/list-view/list-view.blade.php index 0777c33..eba3450 100644 --- a/resources/views/list-view/list-view.blade.php +++ b/resources/views/list-view/list-view.blade.php @@ -20,7 +20,7 @@ @endforeach @else {{-- Empty data message --}} - + @endif
diff --git a/resources/views/table-view/table-view.blade.php b/resources/views/table-view/table-view.blade.php index 8a43669..a8c8139 100644 --- a/resources/views/table-view/table-view.blade.php +++ b/resources/views/table-view/table-view.blade.php @@ -25,7 +25,7 @@ @else {{-- Empty data message --}} - + @endif {{-- Paginator, loading indicator and totals --}}