From 71d93ca3c38f6813c46bae77e62ab8be70944c30 Mon Sep 17 00:00:00 2001 From: Marcus Moore Date: Tue, 11 Mar 2025 11:41:26 -0700 Subject: [PATCH] Use dedicated location select component Copy/paste/modify from partials.forms.edit.location-select --- .../blade/input/location-select.blade.php | 62 +++++++++++++++++++ resources/views/hardware/checkin.blade.php | 21 ++++++- 2 files changed, 82 insertions(+), 1 deletion(-) create mode 100644 resources/views/blade/input/location-select.blade.php diff --git a/resources/views/blade/input/location-select.blade.php b/resources/views/blade/input/location-select.blade.php new file mode 100644 index 000000000..3b513b95d --- /dev/null +++ b/resources/views/blade/input/location-select.blade.php @@ -0,0 +1,62 @@ +@use('App\Models\Location', 'Location') +@use('Illuminate\Support\Arr', 'Arr') + +@props([ + 'label', + 'name', + 'selected', + 'required' => false, + 'multiple' => false, + 'helpText' => null, + 'hideNewButton' => false, +]) + +
$errors->has($name), + ]) +> + + +
+ +
+ +
+ @unless($hideNewButton) + @can('create', Location::class) + {{ trans('button.new') }} + @endcan + @endunless +
+ + {!! $errors->first($name, '
') !!} + + @if ($helpText) +
+

{{ $helpText }}

+
+ @endif + +
diff --git a/resources/views/hardware/checkin.blade.php b/resources/views/hardware/checkin.blade.php index 5510ff89a..fbf2aa75c 100755 --- a/resources/views/hardware/checkin.blade.php +++ b/resources/views/hardware/checkin.blade.php @@ -95,7 +95,26 @@ - @include ('partials.forms.edit.location-select', ['translated_name' => trans('general.location'), 'fieldname' => 'location_id', 'help_text' => ($asset->defaultLoc) ? trans('general.checkin_to_diff_location', ['default_location' => $asset->defaultLoc->name]) : null, 'hide_location_radio' => true]) + + + +
+
+ + +
+