[TASK] Optimize template handling for FSC: Bullets 07/48407/4
authorFrank Naegler <frank.naegler@typo3.org>
Mon, 30 May 2016 16:00:06 +0000 (18:00 +0200)
committerJan Helke <typo3@helke.de>
Fri, 3 Jun 2016 14:03:44 +0000 (16:03 +0200)
Split the bullets template from FSC into partials.

Resolves: #75333
Releases: master
Change-Id: I5dd191f534f2ecf1c604c682e60374382c2b8f14
Reviewed-on: https://review.typo3.org/48407
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Gianluigi Martino <gmartino27@gmail.com>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Marco Bresch <marco.bresch@starfinanz.de>
Reviewed-by: Jan Helke <typo3@helke.de>
Tested-by: Jan Helke <typo3@helke.de>
typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-0.html [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-1.html [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-2.html [new file with mode: 0644]
typo3/sysext/fluid_styled_content/Resources/Private/Templates/Bullets.html

diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-0.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-0.html
new file mode 100644 (file)
index 0000000..f669b7a
--- /dev/null
@@ -0,0 +1,9 @@
+<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/FluidStyledContent/ViewHelpers" data-namespace-typo3-fluid="true">
+<f:if condition="{bullets}">
+       <ul class="ce-bullets">
+       <f:for each="{bullets}" as="bullet">
+               <li>{bullet}</li>
+       </f:for>
+       </ul>
+</f:if>
+</html>
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-1.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-1.html
new file mode 100644 (file)
index 0000000..420a60c
--- /dev/null
@@ -0,0 +1,9 @@
+<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/FluidStyledContent/ViewHelpers" data-namespace-typo3-fluid="true">
+<f:if condition="{bullets}">
+       <ol class="ce-bullets">
+       <f:for each="{bullets}" as="bullet">
+               <li>{bullet}</li>
+       </f:for>
+       </ol>
+</f:if>
+</html>
diff --git a/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-2.html b/typo3/sysext/fluid_styled_content/Resources/Private/Partials/Bullets/Type-2.html
new file mode 100644 (file)
index 0000000..6cdd7ad
--- /dev/null
@@ -0,0 +1,18 @@
+<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers" xmlns:ce="http://typo3.org/ns/TYPO3/CMS/FluidStyledContent/ViewHelpers" data-namespace-typo3-fluid="true">
+<f:if condition="{bullets}">
+       <dl class="ce-bullets">
+       <f:for each="{bullets}" as="definitionListItem">
+               <f:for each="{definitionListItem}" as="termDescription" iteration="termDescriptionIterator">
+                       <f:if condition="{termDescriptionIterator.isFirst}">
+                               <f:then>
+                                       <dt>{termDescription}</dt>
+                               </f:then>
+                               <f:else>
+                                       <dd>{termDescription}</dd>
+                               </f:else>
+                       </f:if>
+               </f:for>
+       </f:for>
+       </dl>
+</f:if>
+</html>
index 1d08262..a465269 100644 (file)
@@ -2,39 +2,6 @@
 <f:layout name="HeaderContentFooter" />
 
 <f:section name="content">
-       <f:if condition="{bullets}">
-               <f:switch expression="{data.bullets_type}">
-                       <f:case value="0">
-                               <ul class="ce-bullets">
-                                       <f:for each="{bullets}" as="bullet">
-                                               <li>{bullet}</li>
-                                       </f:for>
-                               </ul>
-                       </f:case>
-                       <f:case value="1">
-                               <ol class="ce-bullets">
-                                       <f:for each="{bullets}" as="bullet">
-                                               <li>{bullet}</li>
-                                       </f:for>
-                               </ol>
-                       </f:case>
-                       <f:case value="2">
-                               <dl class="ce-bullets">
-                                       <f:for each="{bullets}" as="definitionListItem">
-                                               <f:for each="{definitionListItem}" as="termDescription" iteration="termDescriptionIterator">
-                                                       <f:if condition="{termDescriptionIterator.isFirst}">
-                                                               <f:then>
-                                                                       <dt>{termDescription}</dt>
-                                                               </f:then>
-                                                               <f:else>
-                                                                       <dd>{termDescription}</dd>
-                                                               </f:else>
-                                                       </f:if>
-                                               </f:for>
-                                       </f:for>
-                               </dl>
-                       </f:case>
-               </f:switch>
-       </f:if>
+       <f:render partial="Bullets/Type-{data.bullets_type}" arguments="{_all}" />
 </f:section>
-</html>
\ No newline at end of file
+</html>