@php require_frontend_packages(['bootstrap-select']); @endphp
@once
@push('componentScripts')
@endpush
@endonce
@if(count($userfields) > 0)
{{ $__t('Userfields') }}
@foreach($userfields as $userfield)
@if($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_SINGLE_LINE_TEXT)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_SINGLE_MULTILINE_TEXT)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_INT)
@include('components.numberpicker', array(
'id' => $userfield->name,
'label' => $userfield->caption,
'noNameAttribute' => true,
'min' => 0,
'isRequired' => $userfield->input_required == 1,
'additionalCssClasses' => 'userfield-input',
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
'value' => ''
))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_DECIMAL)
@include('components.numberpicker', array(
'id' => '',
'label' => $userfield->caption,
'noNameAttribute' => true,
'min' => 0,
'decimals' => 4,
'isRequired' => $userfield->input_required == 1,
'additionalCssClasses' => 'userfield-input',
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
'value' => ''
))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_NUMBER_CURRENCY)
@include('components.numberpicker', array(
'id' => '',
'label' => $userfield->caption,
'noNameAttribute' => true,
'min' => 0,
'decimals' => 4,
'isRequired' => $userfield->input_required == 1,
'additionalCssClasses' => 'userfield-input locale-number-input locale-number-currency',
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"',
'value' => ''
))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_DATE)
@include('components.datetimepicker2', array(
'id' => $userfield->name,
'label' => $userfield->caption,
'noNameAttribute' => true,
'format' => 'YYYY-MM-DD',
'initWithNow' => false,
'limitEndToNow' => false,
'limitStartToNow' => false,
'additionalGroupCssClasses' => 'date-only-datetimepicker2',
'isRequired' => $userfield->input_required == 1,
'additionalCssClasses' => 'userfield-input',
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"'
))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_DATETIME)
@include('components.datetimepicker2', array(
'id' => $userfield->name,
'label' => $userfield->caption,
'noNameAttribute' => true,
'format' => 'YYYY-MM-DD HH:mm:ss',
'initWithNow' => false,
'limitEndToNow' => false,
'limitStartToNow' => false,
'isRequired' => $userfield->input_required == 1,
'additionalCssClasses' => 'userfield-input',
'additionalAttributes' => 'data-userfield-name="' . $userfield->name . '"'
))
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_CHECKBOX)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_LIST)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_PRESET_CHECKLIST)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK)
input_required == 1) required @endif>
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_LINK_WITH_TITLE)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_FILE)
@elseif($userfield->type == \Grocy\Services\UserfieldsService::USERFIELD_TYPE_IMAGE)
@endif
@endforeach
@endif