mirror of
https://github.com/snipe/snipe-it.git
synced 2025-02-02 08:21:09 -08:00
disable input when field is unique
This commit is contained in:
parent
8b8e7cb5ee
commit
50a518e5f3
|
@ -20,6 +20,14 @@
|
|||
<div class="form-group{{ $errors->has($field->db_column_name()) ? ' has-error' : '' }}">
|
||||
<label for="{{ $field->db_column_name() }}" class="col-md-3 control-label">{{ $field->name }} </label>
|
||||
<div class="col-md-7 col-sm-12{{ ($field->pivot->required=='1') ? ' required' : '' }}">
|
||||
{{-- @if ($field->is_unique)
|
||||
<div>
|
||||
<label>
|
||||
<input type="text" class="col-md-6 form-control" disabled value="this is unique can't be edited">
|
||||
{{ $field->name }}
|
||||
</label>
|
||||
</div>
|
||||
@else --}}
|
||||
|
||||
|
||||
@if ($field->element!='text')
|
||||
|
@ -66,11 +74,18 @@
|
|||
|
||||
|
||||
@else
|
||||
|
||||
@if (($field->field_encrypted=='0') || (Gate::allows('admin')))
|
||||
@if ($field->is_unique)
|
||||
<input type="text" class="form-control" disabled value="This is a unique field and can not be edited">
|
||||
@endif
|
||||
@if(!$field->is_unique)
|
||||
<input type="text" value="{{ Request::old($field->db_column_name(),(isset($item) ? Helper::gracefulDecrypt($field, $item->{$field->db_column_name()}) : $field->defaultValue($model->id))) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}" placeholder="Enter {{ strtolower($field->format) }} text">
|
||||
@endif
|
||||
@else
|
||||
<input type="text" value="{{ strtoupper(trans('admin/custom_fields/general.encrypted')) }}" class="form-control disabled" disabled>
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
||||
@endif
|
||||
|
@ -78,6 +93,9 @@
|
|||
@if ($field->help_text!='')
|
||||
<p class="help-block">{{ $field->help_text }}</p>
|
||||
@endif
|
||||
{{-- @if ($field->is_unique)
|
||||
<p class="help-block">Unique, Can't Be Bulk Updated</p>
|
||||
@endif --}}
|
||||
|
||||
|
||||
<p>{{ trans('admin/hardware/form.bulk_update_model_prefix') }}
|
||||
|
@ -108,6 +126,7 @@
|
|||
|
||||
|
||||
</div>
|
||||
{{-- @endif --}}
|
||||
@endforeach
|
||||
@endif
|
||||
@endforeach
|
||||
|
|
Loading…
Reference in a new issue