{{define "profile_optional_fields_display"}} {{if .other_properties}} {{range .fields}} {{$fieldName := .name}} {{$fieldLabel := .label}} {{if eq .type "multicheckbox"}} {{$hasValues := false}} {{range .options}} {{$optionKey := printf "%s___%s" $fieldName .value}} {{if index $.other_properties $optionKey}}{{$hasValues = true}}{{end}} {{end}} {{if $hasValues}}
{{$fieldLabel}}
{{range .options}} {{$optionKey := printf "%s___%s" $fieldName .value}} {{if index $.other_properties $optionKey}} {{.label}} {{end}} {{end}}
{{end}} {{else if eq .type "select"}} {{$fieldValue := index $.other_properties $fieldName}} {{if and $fieldValue (ne $fieldValue "0") (ne $fieldValue "")}}
{{$fieldLabel}}
{{if eq $fieldName "gender"}} {{genderISO5218 $fieldValue}} {{else}} {{range .options}} {{if eq .value $fieldValue}}{{.label}}{{end}} {{end}} {{end}}
{{end}} {{else if eq .type "date"}} {{$fieldValue := index $.other_properties $fieldName}} {{if $fieldValue}}
{{$fieldLabel}}
{{ (timeFrom $fieldValue).Format "02/01/2006" }}
{{end}} {{else}} {{$fieldValue := index $.other_properties $fieldName}} {{if $fieldValue}}
{{$fieldLabel}}
{{$fieldValue}}
{{end}} {{end}} {{end}} {{end}} {{end}}