mirror of
https://github.com/snipe/snipe-it.git
synced 2025-01-13 15:01:02 -08:00
Custom fields form in asset edit view
This commit is contained in:
parent
c49f10c9bb
commit
122f0b9cba
|
@ -1,13 +1,32 @@
|
||||||
@if($model->fieldset)
|
@if($model->fieldset)
|
||||||
@foreach($model->fieldset->fields AS $field)
|
@foreach($model->fieldset->fields AS $field)
|
||||||
<div class="form-group {{ $errors->has($field->db_column_name()) ? ' has-error' : '' }}">
|
<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 for="{{ $field->db_column_name() }}" class="col-md-3 control-label">{{ $field->name }} </label>
|
||||||
@if ($field->pivot->required=='1')
|
<div class="col-md-7 col-sm-12{{ ($field->pivot->required=='1') ? ' required' : '' }}">
|
||||||
*
|
|
||||||
@endif
|
@if ($field->element!='text')
|
||||||
|
|
||||||
|
@if ($field->element=='listbox')
|
||||||
|
{{ Form::select($field->db_column_name(), $field->formatFieldValuesAsArray(), Input::old($field->db_column_name(), $asset->{$field->db_column_name()}), ['class'=>'format select2 form-control']) }}
|
||||||
|
@elseif ($field->element=='checkbox')
|
||||||
|
|
||||||
|
@foreach ($field->formatFieldValuesAsArray() as $key => $value)
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<label>
|
||||||
|
<input type="checkbox" value="1" name="{{ $key }}[]" class="minimal" {{ Input::old($field->db_column_name()) == '1' ? ' checked="checked"' : '' }}> {{ $value }}
|
||||||
</label>
|
</label>
|
||||||
<div class="col-md-7 col-sm-12">
|
</div>
|
||||||
|
@endforeach
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
|
|
||||||
|
@else
|
||||||
<input type="text" value="{{ Input::old($field->db_column_name(),(isset($asset) ? $asset->{$field->db_column_name()} : "")) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}">
|
<input type="text" value="{{ Input::old($field->db_column_name(),(isset($asset) ? $asset->{$field->db_column_name()} : "")) }}" id="{{ $field->db_column_name() }}" class="form-control" name="{{ $field->db_column_name() }}">
|
||||||
|
|
||||||
|
@endif
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
$errormessage=$errors->first($field->db_column_name());
|
$errormessage=$errors->first($field->db_column_name());
|
||||||
if ($errormessage) {
|
if ($errormessage) {
|
||||||
|
|
Loading…
Reference in a new issue