@php //set array up before loop so it doesn't get wiped at every iteration $fields = []; $anyModelHasCustomFields = 0; @endphp @foreach($models as $model) @if (($model) && ($model->fieldset ? $model->fieldset->count() > 0 : false)) @php $anyModelHasCustomFields++; @endphp @endif @endforeach @if ($anyModelHasCustomFields > 0)
{{ trans('admin/custom_fields/general.custom_fields') }} @endif @foreach($models as $model) @if (($model) && ($model->fieldset)) @foreach($model->fieldset->fields AS $field) @php //prevents some duplicate queries - open to a better way of skipping dupes in output //its ugly, but if we'd rather deal with duplicate queries we can get rid of this. if (in_array($field->db_column_name(), $fields)) { $duplicate = true; continue; } else { $duplicate = false; } $fields[] = $field->db_column_name(); @endphp
@if ($field->element!='text') @if ($field->element=='listbox') @elseif ($field->element=='textarea') @if($field->is_unique) @endif @if(!$field->is_unique) @endif @elseif ($field->element=='checkbox') @php $fieldName = $field->db_column_name(); $oldValues = old($fieldName); $currentValues = isset($item) ? array_map('trim', explode(',', $item->{$fieldName})) : ''; $selectedValues = is_array($oldValues) ? $oldValues : []; @endphp @foreach ($field->formatFieldValuesAsArray() as $key => $value) @endforeach @elseif ($field->element=='radio') @php $fieldName = $field->db_column_name(); $oldValue = old($fieldName); $current = isset($item) ? trim($item->{$fieldName}) : ''; $selectedValue = $oldValue !== null ? $oldValue : $current; @endphp @foreach ($field->formatFieldValuesAsArray() as $key => $value) @endforeach @elseif ($field->element=='date_picker')
@elseif ($field->element=='datetime_picker')
@endif @else @if ($field->format=='DATE')
@elseif ($field->format=='DATETIME') {{-- Outer wrapper with inline padding-left: 0 to match the DATE case above; conflicting duplicate CSS rules for .input-group[class*="col-"] otherwise re-apply the 15px grid padding. --}}
@else @if (($field->field_encrypted=='0') || (Gate::allows('admin'))) @if ($field->is_unique) @endif @if(!$field->is_unique) format) === 'MAC') inputmode="text" autocomplete="off" @endif placeholder="{{ strtoupper($field->format) === 'MAC' ? 'AA:BB:CC:DD:EE:FF' : 'Enter '.strtolower($field->format).' text' }}"> @endif @else @endif @endif @endif

{{ trans('admin/hardware/form.bulk_update_model_prefix') }}: @foreach ($field->assetModels()->pluck('name')->intersect($modelNames) as $modelName) {{ $modelName }}   @endforeach

@if ($field->help_text!='')

{{ $field->help_text }}

@endif