<#macro userProfileFormFields> <#assign currentGroup=""> <#list profile.attributes as attribute> <#assign groupName = attribute.group!""> <#if groupName != currentGroup> <#assign currentGroup=groupName> <#if currentGroup != "" >
<#assign groupDisplayHeader=attribute.groupDisplayHeader!""> <#if groupDisplayHeader != ""> <#assign groupHeaderText=advancedMsg(attribute.groupDisplayHeader)!groupName> <#else> <#assign groupHeaderText=groupName>
<#assign groupDisplayDescription=attribute.groupDisplayDescription!""> <#if groupDisplayDescription != ""> <#assign groupDescriptionText=advancedMsg(attribute.groupDisplayDescription)!"">
<#nested "beforeField" attribute>
<#if attribute.required>*
<#if attribute.annotations.inputHelperTextBefore??>
${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextBefore))?no_esc}
<@inputFieldByType attribute=attribute/> <#if messagesPerField.existsError('${attribute.name}')> ${kcSanitize(messagesPerField.get('${attribute.name}'))?no_esc} <#if attribute.annotations.inputHelperTextAfter??>
${kcSanitize(advancedMsg(attribute.annotations.inputHelperTextAfter))?no_esc}
<#nested "afterField" attribute> <#macro inputFieldByType attribute> <#switch attribute.annotations.inputType!''> <#case 'textarea'> <@textareaTag attribute=attribute/> <#break> <#case 'select'> <#case 'multiselect'> <@selectTag attribute=attribute/> <#break> <#case 'select-radiobuttons'> <#case 'multiselect-checkboxes'> <@inputTagSelects attribute=attribute/> <#break> <#default> <@inputTag attribute=attribute/> <#macro inputTag attribute> disabled <#if attribute.autocomplete??>autocomplete="${attribute.autocomplete}" <#if attribute.annotations.inputTypePlaceholder??>placeholder="${attribute.annotations.inputTypePlaceholder}" <#if attribute.annotations.inputTypePattern??>pattern="${attribute.annotations.inputTypePattern}" <#if attribute.annotations.inputTypeSize??>size="${attribute.annotations.inputTypeSize}" <#if attribute.annotations.inputTypeMaxlength??>maxlength="${attribute.annotations.inputTypeMaxlength}" <#if attribute.annotations.inputTypeMinlength??>minlength="${attribute.annotations.inputTypeMinlength}" <#if attribute.annotations.inputTypeMax??>max="${attribute.annotations.inputTypeMax}" <#if attribute.annotations.inputTypeMin??>min="${attribute.annotations.inputTypeMin}" <#if attribute.annotations.inputTypeStep??>step="${attribute.annotations.inputTypeStep}" /> <#macro inputTagType attribute> <#compress> <#if attribute.annotations.inputType??> <#if attribute.annotations.inputType?starts_with("html5-")> ${attribute.annotations.inputType[6..]} <#else> ${attribute.annotations.inputType} <#else> text <#macro textareaTag attribute> <#macro selectTag attribute> <#macro inputTagSelects attribute> <#if attribute.annotations.inputType=='select-radiobuttons'> <#assign inputType='radio'> <#assign classDiv=properties.kcInputClassRadio!> <#assign classInput=properties.kcInputClassRadioInput!> <#assign classLabel=properties.kcInputClassRadioLabel!> <#else> <#assign inputType='checkbox'> <#assign classDiv=properties.kcInputClassCheckbox!> <#assign classInput=properties.kcInputClassCheckboxInput!> <#assign classLabel=properties.kcInputClassCheckboxLabel!> <#if attribute.annotations.inputOptionsFromValidation?? && attribute.validators[attribute.annotations.inputOptionsFromValidation]?? && attribute.validators[attribute.annotations.inputOptionsFromValidation].options??> <#assign options=attribute.validators[attribute.annotations.inputOptionsFromValidation].options> <#elseif attribute.validators.options?? && attribute.validators.options.options??> <#assign options=attribute.validators.options.options> <#if options??> <#list options as option>
disabled <#if attribute.values?seq_contains(option)>checked />
<#macro selectOptionLabelText attribute option> <#compress> <#if attribute.annotations.inputOptionLabels??> ${advancedMsg(attribute.annotations.inputOptionLabels[option]!option)} <#else> <#if attribute.annotations.inputOptionLabelsI18nPrefix??> ${msg(attribute.annotations.inputOptionLabelsI18nPrefix + '.' + option)} <#else> ${option}