Handle checkboxes
This commit is contained in:
@@ -0,0 +1,65 @@
|
||||
<!-- form-row blade component -->
|
||||
@props([
|
||||
'errors',
|
||||
'label' => null,
|
||||
'name' => null,
|
||||
'help_text' => null,
|
||||
'label_style' => null,
|
||||
'label_class' => 'col-md-3 col-sm-12 col-xs-12',
|
||||
'div_style' => null,
|
||||
'input_div_class' => 'col-md-8 col-sm-12',
|
||||
'type' => 'checkbox',
|
||||
'item' => null,
|
||||
'disabled' => false,
|
||||
'error_offset_class' => 'col-md-7 col-md-offset-3',
|
||||
'info_tooltip_text' => null,
|
||||
'value_text' => null,
|
||||
])
|
||||
|
||||
<div {{ $attributes->merge(['class' => 'form-group']) }}>
|
||||
|
||||
<x-form-label
|
||||
:$label
|
||||
:for="$name"
|
||||
:style="$label_style ?? null"
|
||||
class="{{ $label_class }}"
|
||||
/>
|
||||
|
||||
<div {{ $attributes->merge(['class' => $input_div_class]) }} {{ ($div_style) ? $attributes->merge(['style' => $div_style]):'' }}>
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="{{ $name }}" aria-label="{{ $name }}" @checked(old($name, $item->$name))>
|
||||
{{ $value_text }}
|
||||
</label>
|
||||
</div>
|
||||
|
||||
|
||||
@if ($info_tooltip_text)
|
||||
<!-- Info Tooltip -->
|
||||
<div class="col-md-1 text-left" style="padding-left:0; margin-top: 5px;">
|
||||
<x-input.info-tooltip>
|
||||
{{ $info_tooltip_text }}
|
||||
</x-input.info-tooltip>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
|
||||
@error($name)
|
||||
<!-- Form Error -->
|
||||
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
|
||||
<span class="alert-msg" role="alert">
|
||||
<i class="fas fa-times" aria-hidden="true"></i>
|
||||
{{ $message }}
|
||||
</span>
|
||||
</div>
|
||||
@enderror
|
||||
|
||||
@if ($help_text)
|
||||
<!-- Help Text -->
|
||||
<div {{ $attributes->merge(['class' => $error_offset_class]) }}>
|
||||
<p class="help-block">
|
||||
{!! $help_text !!}
|
||||
</p>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</div>
|
||||
@@ -84,19 +84,15 @@
|
||||
type="email"
|
||||
/>
|
||||
|
||||
<!-- Reassignable -->
|
||||
<div class="form-group {{ $errors->has('reassignable') ? ' has-error' : '' }}">
|
||||
<div class="col-md-3 control-label">
|
||||
<strong>{{ trans('admin/licenses/form.reassignable') }}</strong>
|
||||
</div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="reassignable" value="1" aria-label="reassignable" @checked(old('reassignable', $item->id ? $item->reassignable : '1'))>
|
||||
{{ trans('general.yes') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Reassignable -->
|
||||
<x-form-row-checkbox
|
||||
:label="trans('admin/licenses/form.reassignable')"
|
||||
:$item
|
||||
:$errors
|
||||
name="reassignable"
|
||||
disabled="true"
|
||||
:value_text="trans('general.yes')"
|
||||
/>
|
||||
|
||||
@include ('partials.forms.edit.supplier-select', ['translated_name' => trans('general.supplier'), 'fieldname' => 'supplier_id'])
|
||||
|
||||
@@ -171,16 +167,14 @@
|
||||
|
||||
@include ('partials.forms.edit.depreciation')
|
||||
|
||||
<!-- Maintained -->
|
||||
<div class="form-group {{ $errors->has('maintained') ? ' has-error' : '' }}">
|
||||
<div class="col-md-3 control-label"><strong>{{ trans('admin/licenses/form.maintained') }}</strong></div>
|
||||
<div class="col-md-7">
|
||||
<label class="form-control">
|
||||
<input type="checkbox" name="maintained" value="1" aria-label="maintained" @checked(old('maintained', $item->maintained))>
|
||||
{{ trans('general.yes') }}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Maintained -->
|
||||
<x-form-row-checkbox
|
||||
:label="trans('admin/licenses/form.maintained')"
|
||||
:$item
|
||||
:$errors
|
||||
name="maintained"
|
||||
/>
|
||||
|
||||
|
||||
<!-- Notes -->
|
||||
<x-form-row
|
||||
|
||||
Reference in New Issue
Block a user