@if (($model) && ($model->fieldset) && $model->fieldset->displayAnyFieldsInForm($show_custom_fields_type ?? ''))
{{ trans('admin/custom_fields/general.custom_fields') }} @foreach($model->fieldset->fields as $field) @if (!isset($show_custom_fields_type) || ($field->displayFieldInCurrentForm($show_custom_fields_type)))
@if ($field->element!='text') @if ($field->element=='listbox') @elseif ($field->element=='textarea') @elseif ($field->element=='markdown-textarea') {{ trans('general.markdown') }} @elseif ($field->element=='checkbox') @foreach ($field->formatFieldValuesAsArray() as $key => $value)
@endforeach @elseif ($field->element=='radio') @foreach ($field->formatFieldValuesAsArray() as $value)
@endforeach @elseif ($field->element=='date_picker') {{-- Datepicker widget on a plain TEXT column (allows the field to be encrypted). Format DATE uses a separate native-column path below. --}}
@elseif ($field->element=='datetime_picker') {{-- Datetimepicker widget on a plain TEXT column (allows the field to be encrypted). Format DATETIME uses a separate native-column path below. --}}
@endif @else @if ($field->format=='DATE')
@elseif ($field->format=='DATETIME') {{-- Outer wrapper with inline padding-left: 0 to match the DATE case above. Later duplicate .input-group[class*="col-"] CSS rules re-apply 15px padding that would otherwise indent the widget; the inline style forces it to zero. --}}
@else @if (($field->field_encrypted=='0') || (Gate::allows('assets.view.encrypted_custom_fields'))) @php $format_icon = \App\Models\CustomField::iconForFormat($field->format); // MAC fields get a client-side input mask (see // window.snipeitInitMacAddressMask in snipeit.js) // that normalizes any hex-shaped paste to the // colon-separated AA:BB:CC:DD:EE:FF form the // backend rule enforces. Both branches below // (with and without $format_icon) need the class // + shared placeholder / maxlength / inputmode / // autocomplete attrs, so they're built once here // and interpolated. $isMac = strtoupper($field->format) === 'MAC'; $macClass = $isMac ? ' mac-address-input' : ''; // No maxlength: browser-side length caps run // BEFORE the input event fires, so a slightly- // over-length paste (e.g. a stray leading quote // from a copied cell) would get truncated by // the browser and lose a trailing hex char // before the mask's substring(0, 12) had a // chance to normalize. The mask itself is the // authoritative cap. $macAttrs = $isMac ? ' inputmode="text" autocomplete="off"' : ''; $placeholder = $isMac ? 'AA:BB:CC:DD:EE:FF' : 'Enter '.strtolower($field->format).' text'; @endphp @if ($format_icon)
pivot->required=='1') ? ' required' : '' }}>
@else pivot->required=='1') ? ' required' : '' }}> @endif @else @endif @endif @endif @if (count(\App\Presenters\CustomFieldPresenter::visibilityIconsArray($field)) > 0) @if ($field->help_text != '')

{{ $field->help_text }}
{!! \App\Presenters\CustomFieldPresenter::visibilityIcons($field) !!}

@else
{!! \App\Presenters\CustomFieldPresenter::visibilityIcons($field) !!}
@endif @elseif ($field->help_text != '')

{{ $field->help_text }}

@endif