Commit 973ffb7a authored by Andreas Steiger's avatar Andreas Steiger Committed by Christian Kuhn
Browse files

[TASK] EXT:form - Optimize frontend templates

* add attribute role="alert" to error hints
* streamline bootstrap 3 error classes
* add attribute formnovalidate to previous button of multistep form
* remove fieldset wrap from element type 'PAGE'

Resolves: #69974
Releases: master
Change-Id: I66336879bed0f94752482404c3ed7cfa7028046d
Reviewed-on: https://review.typo3.org/51426

Tested-by: default avatarTYPO3com <no-reply@typo3.com>
Reviewed-by: Björn Jacob's avatarBjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Björn Jacob's avatarBjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
parent a62dbd10
{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
<div class="form-group">
<label for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
<div class="{element.properties.containerClassAttribute}">
<f:render section="field" />
<f:format.raw>
<f:form.validationResults for="{element.identifier}">
<f:form.validationResults for="{element.identifier}">
<div class="form-group{f:if(condition: '{validationResults.errors.0}', then: ' has-error')}">
<label class="control-label" for="{element.uniqueIdentifier}">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
<div class="{element.properties.containerClassAttribute}">
<f:render section="field" />
<f:format.raw>
<f:if condition="{validationResults.flattenedErrors}">
<span class="form-control-feedback error help-inline">
<span class="error help-block" role="alert">
<f:for each="{validationResults.errors}" as="error">
{error -> f:translate(key: '{element.renderingOptions.translation.translationFile}:validation.error.{error.code}', arguments: error.arguments)}
{error -> f:translate(key: 'LLL:{element.renderingOptions.translation.translationFile}:validation.error.{error.code}', arguments: error.arguments)}
<br />
</f:for>
</span>
</f:if>
</f:form.validationResults>
</f:format.raw>
<f:if condition="{element.properties.elementDescription}">
<span class="help-block">{formvh:translateElementProperty(element: element, property: 'elementDescription')}</span>
</f:if>
</f:format.raw>
<f:if condition="{element.properties.elementDescription}">
<span class="help-block">{formvh:translateElementProperty(element: element, property: 'elementDescription')}</span>
</f:if>
</div>
</div>
</div>
\ No newline at end of file
</f:form.validationResults>
......@@ -3,7 +3,7 @@
<div class="btn-group" role="group">
<f:if condition="{form.previousPage}">
<span class="previous">
<f:form.button property="__currentPage" value="{form.previousPage.index}" class="btn btn-cancel">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
<f:form.button property="__currentPage" value="{form.previousPage.index}" class="btn btn-cancel" formnovalidate="formnovalidate">{formvh:translateElementProperty(element: form.currentPage, renderingOptionProperty: 'previousButtonLabel')}</f:form.button>
</span>
</f:if>
<f:if condition="{form.nextPage}">
......
{namespace formvh=TYPO3\CMS\Form\ViewHelpers}
<fieldset class="form-group">
<f:if condition="{page.label}">
<legend>{formvh:translateElementProperty(element: page, property: 'label')}</legend>
</f:if>
<f:for each="{page.elements}" as="element">
<formvh:renderRenderable renderable="{element}" />
</f:for>
</fieldset>
\ No newline at end of file
<f:if condition="{page.label}">
<h2>{formvh:translateElementProperty(element: page, property: 'label')}</h2>
</f:if>
<f:for each="{page.elements}" as="element">
<formvh:renderRenderable renderable="{element}" />
</f:for>
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment