mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-11 22:07:29 -08:00
Display asset name if one exists and the user cannot edit
This commit is contained in:
parent
539c3023b9
commit
6b6cf06530
|
@ -46,14 +46,25 @@
|
|||
@endif
|
||||
|
||||
<!-- Asset Name -->
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" id="name"
|
||||
value="{{ Input::old('name', $asset->name) }}"/>
|
||||
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
<!-- Only allow an asset name to be changed if the checker-outer has permission to edit the asset -->
|
||||
@can('update', $asset)
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<input class="form-control" type="text" name="name" id="name" value="{{ Input::old('name', $asset->name) }}" tabindex="1">
|
||||
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@if ($asset->name!='')
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">{{ $asset->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
<!-- Status -->
|
||||
<div class="form-group {{ $errors->has('status_id') ? 'error' : '' }}">
|
||||
|
|
|
@ -46,6 +46,15 @@
|
|||
{!! $errors->first('name', '<span class="alert-msg"><i class="fa fa-times"></i> :message</span>') !!}
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
@if ($asset->name!='')
|
||||
<div class="form-group {{ $errors->has('name') ? 'error' : '' }}">
|
||||
{{ Form::label('name', trans('admin/hardware/form.name'), array('class' => 'col-md-3 control-label')) }}
|
||||
<div class="col-md-8">
|
||||
<p class="form-control-static">{{ $asset->name }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endcan
|
||||
|
||||
@include ('partials.forms.checkout-selector', ['user_select' => 'true','asset_select' => 'true', 'location_select' => 'true'])
|
||||
|
|
Loading…
Reference in a new issue