| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081 |
- {namespace vh=In2code\Powermail\ViewHelpers}
- <f:form.validationResults>
- <f:if condition="{validationResults.flattenedErrors}">
- <nav class="powermail_message powermail_message_error" aria-label="{f:translate(key: 'validationerror_container_label')}">
- <h2><f:translate key="validationerror_title" /></h2>
- <ol>
- <f:for each="{validationResults.flattenedErrors}" as="errors">
- <f:for each="{errors}" as="singleError">
- <li>
- <f:if condition="{singleError.message} == 'spam_details'">
- <f:then>
- <f:comment>
- Show spam message
- </f:comment>
- <f:translate key="validationerror_spam" /> {singleError.arguments.spamfactor}
- <f:translate key="validationerror_{singleError.message}">{singleError.message}</f:translate>
- </f:then>
- <f:else>
- <f:comment>
- Show field error message
- </f:comment>
- <f:if condition="{singleError.arguments.marker}">
- <f:if condition="{vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'type')} == 'check'
- || {vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'type')} == 'radio'">
- <f:then>
- <f:comment>
- "Hack" to link to the first checkbox/ radio
- </f:comment>
- <a href="#powermail_field_{singleError.arguments.marker}_1">
- <vh:getter.getFieldPropertyFromMarkerAndForm marker="{singleError.arguments.marker}" form="{form}" property="title"/>:
- <f:if condition="{vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'mandatory_text')} !== ''">
- <f:then>
- <f:comment>
- Show custom error message
- </f:comment>
- {vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'mandatory_text')}
- </f:then>
- <f:else>
- <f:comment>
- Show default error message
- </f:comment>
- <f:translate key="validationerror_{singleError.message}">{singleError.message}</f:translate>
- </f:else>
- </f:if>
- </a>
- </f:then>
- <f:else>
- <a href="#powermail_field_{singleError.arguments.marker}">
- <vh:getter.getFieldPropertyFromMarkerAndForm marker="{singleError.arguments.marker}" form="{form}" property="title"/>:
- <f:if condition="{vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'mandatory_text')} !== ''">
- <f:then>
- <f:comment>
- Show custom error message
- </f:comment>
- {vh:getter.getFieldPropertyFromMarkerAndForm(marker: singleError.arguments.marker, form: form, property: 'mandatory_text')}
- </f:then>
- <f:else>
- <f:comment>
- Show default error message
- </f:comment>
- <f:translate key="validationerror_{singleError.message}">{singleError.message}</f:translate>
- </f:else>
- </f:if>
- </a>
- </f:else>
- </f:if>
- </f:if>
- </f:else>
- </f:if>
- </li>
- </f:for>
- </f:for>
- </ol>
- </nav>
- </f:if>
- </f:form.validationResults>
|