[BUGFIX] EXT:form - fix radio button html markup 64/53364/2
authorRalf Zimmermann <ralf.zimmermann@tritum.de>
Fri, 30 Jun 2017 08:54:10 +0000 (10:54 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 4 Jul 2017 20:57:19 +0000 (22:57 +0200)
Make the radio button html markup closer to
http://getbootstrap.com/css/#checkboxes-and-radios

- remove the "for" attribute from the container label tag
- add the "radio" class to the elements div wrapper
- remove the class attribute from the elements label tag

Resolves: #81715
Releases: master
Change-Id: Ic4be5b51f38fb2313e230bfaf0f85ec7fe8431c9
Reviewed-on: https://review.typo3.org/53364
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Mathias Brodala <mbrodala@pagemachine.de>
Tested-by: Mathias Brodala <mbrodala@pagemachine.de>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
typo3/sysext/form/Resources/Private/Frontend/Partials/RadioButton.html

index c47d217..b707826 100644 (file)
@@ -1,22 +1,25 @@
 <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">
-               <div id="{element.uniqueIdentifier}" class="inputs-list">
-                       <div class="form-group">
-                               <f:for each="{element.properties.options}" as="label" key="value">
-                                       <div class="form-check">
-                                               <label class="form-check-label">
-                                                       <f:form.radio
-                                                               property="{element.identifier}"
-                                                               class="{element.properties.elementClassAttribute} form-check-input"
-                                                               value="{value}"
-                                                               errorClass="{element.properties.elementErrorClassAttribute}"
-                                                               additionalAttributes="{formvh:translateElementProperty(element: element, property: 'fluidAdditionalAttributes')}"
-                                                       />
-                                                       <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
-                                               </label>
-                                       </div>
-                               </f:for>
+       <f:render partial="Field/Field" arguments="{element: element, doNotShowLabel: 1}" contentAs="elementContent">
+               <label class="control-label">{formvh:translateElementProperty(element: element, property: 'label')}<f:if condition="{element.required}"><f:render partial="Field/Required" /></f:if></label>
+               <div class="{element.properties.containerClassAttribute}">
+                       <div id="{element.uniqueIdentifier}" class="inputs-list">
+                               <div class="form-group">
+                                       <f:for each="{element.properties.options}" as="label" key="value">
+                                               <div class="radio">
+                                                       <label>
+                                                               <f:form.radio
+                                                                       property="{element.identifier}"
+                                                                       class="{element.properties.elementClassAttribute} form-check-input"
+                                                                       value="{value}"
+                                                                       errorClass="{element.properties.elementErrorClassAttribute}"
+                                                                       additionalAttributes="{formvh:translateElementProperty(element: element, property: 'fluidAdditionalAttributes')}"
+                                                               />
+                                                               <span>{formvh:translateElementProperty(element: element, property: 'options.{value}')}</span>
+                                                       </label>
+                                               </div>
+                                       </f:for>
+                               </div>
                        </div>
                </div>
        </f:render>