From 83470c3ff575e62a3e7b66f07177ef9c95c8a54d Mon Sep 17 00:00:00 2001 From: Deon George Date: Wed, 14 Aug 2024 22:19:53 +1000 Subject: [PATCH] Enhancements to components, move simplemde over to PageAssets --- resources/components/form/base.blade.php | 12 ++--- resources/components/form/select.blade.php | 32 +++++++------ resources/components/form/textarea.blade.php | 46 +++++++++++++++++-- resources/components/form/toggle.blade.php | 2 +- .../views/layouts/partials/sidebar.blade.php | 2 +- src/PageAssets.php | 10 ++++ src/Providers/CustomBladeServiceProvider.php | 16 +------ src/Providers/LeenooksServiceProvider.php | 3 +- 8 files changed, 80 insertions(+), 43 deletions(-) diff --git a/resources/components/form/base.blade.php b/resources/components/form/base.blade.php index 6f4a2b1..47a6266 100644 --- a/resources/components/form/base.blade.php +++ b/resources/components/form/base.blade.php @@ -1,15 +1,15 @@ -@if(isset($label)) - -@endisset
+ @if(isset($label)) + + @endisset
@if(isset($icon) || isset($prepend))
@isset($icon)@endisset @isset($prepend){!! $prepend !!}@endisset
- @endif() + @endif {{ $slot }} - + @error($old ?? $name) {{ $message }} @elseif(isset($feedback)) @@ -20,4 +20,4 @@ @isset($helper) {{ $helper }} @endif -
+
\ No newline at end of file diff --git a/resources/components/form/select.blade.php b/resources/components/form/select.blade.php index c879228..a6bc852 100644 --- a/resources/components/form/select.blade.php +++ b/resources/components/form/select.blade.php @@ -8,22 +8,24 @@ @endisset @endif - @empty($groupby) - @foreach($options as $option) - @continue(! Arr::get($option,'value')) - - @endforeach + @isset($options) + @empty($groupby) + @foreach($options as $option) + @continue(! Arr::get($option,'value')) + + @endforeach - @else - @foreach($options->groupBy($groupby) as $group) - - @foreach($group as $option) - @continue(! Arr::get($option,'value')) - - @endforeach - - @endforeach - @endempty + @else + @foreach($options->groupBy($groupby) as $group) + + @foreach($group as $option) + @continue(! Arr::get($option,'value')) + + @endforeach + + @endforeach + @endempty + @endisset diff --git a/resources/components/form/textarea.blade.php b/resources/components/form/textarea.blade.php index 248613f..5c8402b 100644 --- a/resources/components/form/textarea.blade.php +++ b/resources/components/form/textarea.blade.php @@ -1,3 +1,43 @@ - - - \ No newline at end of file + +
+ @if(isset($label)) + + @endisset +
+ @if(isset($icon) || isset($prepend)) +
+ @isset($icon)@endisset @isset($prepend){!! $prepend !!}@endisset +
+ @endif +
+ + + @error($old ?? $name) + {{ $message }} + @elseif(isset($feedback)) + {{ $feedback }} + @enderror + +
+
+ @isset($helper) + {{ $helper }} + @endif +
+ +@pa(simplemde) + +@section('page-scripts') + +@append \ No newline at end of file diff --git a/resources/components/form/toggle.blade.php b/resources/components/form/toggle.blade.php index 6f1d342..a3a64e0 100644 --- a/resources/components/form/toggle.blade.php +++ b/resources/components/form/toggle.blade.php @@ -6,7 +6,7 @@ @endif - + @error($name) {{ $message }} @elseif(isset($feedback)) diff --git a/resources/themes/adminlte/views/layouts/partials/sidebar.blade.php b/resources/themes/adminlte/views/layouts/partials/sidebar.blade.php index 9a76f1d..d1f97b8 100644 --- a/resources/themes/adminlte/views/layouts/partials/sidebar.blade.php +++ b/resources/themes/adminlte/views/layouts/partials/sidebar.blade.php @@ -26,7 +26,7 @@