@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_INTEGRAL_NUMBER)
@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_DECIMAL_NUMBER)
@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_DATE)
@include('components.datetimepicker', array(
'id' => $userfield->name,
'label' => $userfield->caption,
'noNameAttribute' => true,
'format' => 'YYYY-MM-DD',
'initWithNow' => false,
'limitEndToNow' => false,
'limitStartToNow' => false,
'additionalGroupCssClasses' => 'date-only-datetimepicker',
'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.datetimepicker', 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