Convert additional Form::select to blade component

This commit is contained in:
Marcus Moore 2025-01-13 16:16:49 -08:00
parent 3eb307a019
commit 9a043da005
No known key found for this signature in database
3 changed files with 44 additions and 18 deletions

View file

@ -359,9 +359,12 @@
trans('general.pie_chart_type')) }} trans('general.pie_chart_type')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ Form::select('dash_chart_type', array( <x-input.select
'name' => 'Status Label Name', name="dash_chart_type"
'type' => 'Status Label Type'), old('dash_chart_type', $setting->dash_chart_type), ['class' =>'select2', 'style' => 'width: 80%']) }} :options="['name' => 'Status Label Name', 'type' => 'Status Label Type']"
:selected="old('dash_chart_type', $setting->dash_chart_type)"
style="width: 80%"
/>
</div> </div>
</div> </div>
@ -372,11 +375,13 @@
{{ Form::label('depreciation_method', trans('Depreciation method')) }} {{ Form::label('depreciation_method', trans('Depreciation method')) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ Form::select('depreciation_method', array( <x-input.select
'default' => 'Linear (default)', name="depreciation_method"
'half_1' => 'Half-year convention, always applied', id="depreciation_method"
'half_2' => 'Half-year convention, applied with condition', :options="['default' => 'Linear (default)', 'half_1' => 'Half-year convention, always applied', 'half_2' => 'Half-year convention, applied with condition']"
), old('username_format', $setting->depreciation_method), ['class' =>'select2', 'style' => 'width: 80%']) }} :selected="old('depreciation_method', $setting->depreciation_method)"
style="width: 80%"
/>
</div> </div>
</div> </div>
<!-- /.form-group --> <!-- /.form-group -->

View file

@ -170,7 +170,14 @@
'none' => trans('admin/settings/general.none'), 'none' => trans('admin/settings/general.none'),
]; ];
@endphp @endphp
{{ Form::select('label2_1d_type', $select1DValues, old('label2_1d_type', $setting->label2_1d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_1d_type' ]) }} <x-input.select
name="label2_1d_type"
id="label2_1d_type"
:options="$select1DValues"
:selected="old('label2_1d_type', $setting->label2_1d_type)"
class="col-md-4"
aria-label="label2_1d_type"
/>
{!! $errors->first('label2_1d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('label2_1d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block"> <p class="help-block">
{{ trans('admin/settings/general.label2_1d_type_help') }}. {{ trans('admin/settings/general.label2_1d_type_help') }}.
@ -214,7 +221,14 @@
'none' => trans('admin/settings/general.none'), 'none' => trans('admin/settings/general.none'),
]); ]);
@endphp @endphp
{{ Form::select('label2_2d_type', $select2DValues, old('label2_2d_type', $setting->label2_2d_type), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_type' ]) }} <x-input.select
name="label2_2d_type"
id="label2_2d_type"
:options="$select2DValues"
:selected="old('label2_2d_type', $setting->label2_2d_type)"
class="col-md-4"
aria-label="label2_2d_type"
/>
{!! $errors->first('label2_2d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('label2_2d_type', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block"> <p class="help-block">
{{ trans('admin/settings/general.label2_2d_type_help', ['current' => $setting->barcode_type]) }}. {{ trans('admin/settings/general.label2_2d_type_help', ['current' => $setting->barcode_type]) }}.
@ -277,13 +291,14 @@
{{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target'), ['class'=>'control-label']) }} {{ Form::label('label2_2d_target', trans('admin/settings/general.label2_2d_target'), ['class'=>'control-label']) }}
</div> </div>
<div class="col-md-9"> <div class="col-md-9">
{{ Form::select('label2_2d_target', [ <x-input.select
'hardware_id' => trans('general.url') .': /hardware/{id} ('.trans('admin/settings/general.default').')', name="label2_2d_target"
'ht_tag' => trans('general.url') .': /ht/{asset_tag}', id="label2_2d_target"
'plain_asset_id' => trans('admin/settings/general.data') .': '. trans('admin/settings/general.asset_id') .' {id}', :options="['hardware_id'=>'/hardware/{id} ('.trans('admin/settings/general.default').')', 'ht_tag'=>'/ht/{asset_tag}']"
'plain_asset_tag' => trans('admin/settings/general.data') .': '. trans('general.asset_tag') .' {asset_tag}', :selected="old('label2_2d_target', $setting->label2_2d_target)"
'plain_serial_number' => trans('admin/settings/general.data') .': '. trans('general.serial_number') .' {serial}', class="col-md-4"
], old('label2_2d_target', $setting->label2_2d_target), [ 'class'=>'select2 col-md-4', 'aria-label'=>'label2_2d_target' ]) }} aria-label="label2_2d_target"
/>
{!! $errors->first('label2_2d_target', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('label2_2d_target', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
<p class="help-block">{{ trans('admin/settings/general.label2_2d_target_help') }}</p> <p class="help-block">{{ trans('admin/settings/general.label2_2d_target_help') }}</p>
</div> </div>

View file

@ -27,7 +27,13 @@
{{ trans('admin/statuslabels/table.status_type') }} {{ trans('admin/statuslabels/table.status_type') }}
</label> </label>
<div class="col-md-7 required"> <div class="col-md-7 required">
{{ Form::select('statuslabel_types', $statuslabel_types, $item->getStatuslabelType(), array('class'=>'select2', 'style'=>'width: 100%; min-width:400px', 'aria-label'=>'statuslabel_types')) }} <x-input.select
name="statuslabel_types"
:options="$statuslabel_types"
:selected="$item->getStatuslabelType()"
style="width: 100%; min-width:400px"
aria-label="statuslabel_types"
/>
{!! $errors->first('statuslabel_types', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!} {!! $errors->first('statuslabel_types', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div> </div>
</div> </div>