Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
snipe committed Apr 7, 2023
2 parents b09b562 + b886f57 commit b3fab6d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
15 changes: 8 additions & 7 deletions resources/views/hardware/edit.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,22 @@
<!-- Asset Tag -->
<div class="form-group {{ $errors->has('asset_tag') ? ' has-error' : '' }}">
<label for="asset_tag" class="col-md-3 control-label">{{ trans('admin/hardware/form.tag') }}</label>

<!-- we are editing an existing asset -->



@if ($item->id)
<!-- we are editing an existing asset, there will be only one asset tag -->
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">


<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tag', $item->asset_tag) }}" data-validation="required">
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
</div>
@else
<!-- we are creating a new asset - let people use more than one asset tag -->
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'asset_tag')) ? ' required' : '' }}">
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tag', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required">
<input class="form-control" type="text" name="asset_tags[1]" id="asset_tag" value="{{ old('asset_tags.1', \App\Models\Asset::autoincrement_asset()) }}" data-validation="required">
{!! $errors->first('asset_tags', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
{!! $errors->first('asset_tag', '<span class="alert-msg"><i class="fas fa-times"></i> :message</span>') !!}
</div>
Expand All @@ -40,11 +44,8 @@
</div>
@endif
</div>




@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'translated_serial' => trans('admin/hardware/form.serial')])
@include ('partials.forms.edit.serial', ['fieldname'=> 'serials[1]', 'old_val_name' => 'serials.1', 'translated_serial' => trans('admin/hardware/form.serial')])

<div class="input_fields_wrap">
</div>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/partials/forms/edit/serial.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div class="form-group {{ $errors->has('serial') ? ' has-error' : '' }}">
<label for="{{ $fieldname }}" class="col-md-3 control-label">{{ trans('admin/hardware/form.serial') }} </label>
<div class="col-md-7 col-sm-12{{ (Helper::checkIfRequired($item, 'serial')) ? ' required' : '' }}">
<input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old('serial', $item->serial) }}" />
<input class="form-control" type="text" name="{{ $fieldname }}" id="{{ $fieldname }}" value="{{ old((isset($old_val_name) ? $old_val_name : $fieldname), $item->serial) }}" />
{!! $errors->first('serial', '<span class="alert-msg" aria-hidden="true"><i class="fas fa-times" aria-hidden="true"></i> :message</span>') !!}
</div>
</div>

0 comments on commit b3fab6d

Please sign in to comment.