[BUGFIX] Make EXT:form checkbox markup compatible to Bootstrap 29/52329/3
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Mon, 3 Apr 2017 09:57:06 +0000 (11:57 +0200)
committerFrans Saris <franssaris@gmail.com>
Tue, 11 Apr 2017 10:12:12 +0000 (12:12 +0200)
Resolves: #80647
Releases: master
Change-Id: I915238b0179c7bbb81196b70a982642b34299773
Reviewed-on: https://review.typo3.org/52329
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Steiger <typo3@andreassteiger.de>
Tested-by: Andreas Steiger <typo3@andreassteiger.de>
Reviewed-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Tested-by: Bjoern Jacob <bjoern.jacob@tritum.de>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Tested-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Henrik Elsner <helsner@dfau.de>
Tested-by: Henrik Elsner <helsner@dfau.de>
Reviewed-by: Frans Saris <franssaris@gmail.com>
Tested-by: Frans Saris <franssaris@gmail.com>
typo3/sysext/form/Configuration/Yaml/BaseSetup.yaml
typo3/sysext/form/Resources/Private/Frontend/Partials/Checkbox.html
typo3/sysext/form/Resources/Private/Frontend/Partials/Field/Field.html

index a0a500b..f1e8127 100644 (file)
@@ -157,11 +157,14 @@ TYPO3:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.FormElementMixin'
               properties:
                 elementClassAttribute: 'add-on'
+                containerClassAttribute: 'input checkbox'
                 value: 1
 
             MultiCheckbox:
               __inheritances:
                 10: 'TYPO3.CMS.Form.mixins.formElementMixins.MultiSelectionMixin'
+              properties:
+                containerClassAttribute: 'input checkbox'
 
             MultiSelect:
               __inheritances:
index 549ee47..1faed89 100644 (file)
@@ -1,6 +1,6 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
 <formvh:renderRenderable renderable="{element}">
-       <f:render partial="Field/Field" arguments="{element: element}" contentAs="elementContent">
+       <f:render partial="Field/Field" arguments="{element: element, doNotShowLabel: 1}" contentAs="elementContent">
                <div class="form-check">
                        <label class="{element.properties.elementClassAttribute} form-check-label">
                                <f:form.checkbox
@@ -11,6 +11,7 @@
                                        errorClass="{element.properties.elementErrorClassAttribute}"
                                        additionalAttributes="{formvh:translateElementProperty(element: element, property: 'fluidAdditionalAttributes')}"
                                />
+                               <span>{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></span>
                        </label>
                </div>
        </f:render>
index 1f6cbfd..6b1107e 100644 (file)
@@ -1,7 +1,9 @@
 <html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:formvh="http://typo3.org/ns/TYPO3/CMS/Form/ViewHelpers" data-namespace-typo3-fluid="true">
 <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>
+               <f:if condition="{doNotShowLabel} != 1">
+                       <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>
+               </f:if>
                <div class="{element.properties.containerClassAttribute}">
                        <f:format.raw>
                                {elementContent}