[TASK] Refactor implementation of PaginateWidget 76/53376/2
authorClaus Due <claus@namelesscoder.net>
Sun, 2 Jul 2017 00:04:07 +0000 (02:04 +0200)
committerJigal van Hemert <jigal.van.hemert@typo3.org>
Sat, 4 Nov 2017 08:24:19 +0000 (09:24 +0100)
Refactors templates to minimise the impact of using the
uncompilable PaginateWidget. By moving the Widget to
a separate partial and the body rendered by the Widget
to another partial the impact is reduced to a minimum,
because the uncompilable template has just two nodes.

Change-Id: I6f1d528ed0c45d776c4952596ac5a8828d04f477
Resolves: #81766
Releases: master, 8.7
Reviewed-on: https://review.typo3.org/53376
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Joerg Boesche <typo3@joergboesche.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Henning Liebe <h.liebe@neusta.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Reviewed-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
Tested-by: Jigal van Hemert <jigal.van.hemert@typo3.org>
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidget.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidgetBody.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidget.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidgetBody.html [new file with mode: 0644]
typo3/sysext/beuser/Resources/Private/Templates/BackendUser/Index.html
typo3/sysext/beuser/Resources/Private/Templates/BackendUserGroup/Index.html

diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidget.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidget.html
new file mode 100644 (file)
index 0000000..598ecaa
--- /dev/null
@@ -0,0 +1,3 @@
+<f:be.widget.paginate objects="{backendUsers}" as="paginatedBackendUsers" configuration="{itemsPerPage: 50, insertBelow: 1}">
+    <f:render partial="BackendUser/PaginatedListWidgetBody" arguments="{_all}" />
+</f:be.widget.paginate>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidgetBody.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUser/PaginatedListWidgetBody.html
new file mode 100644 (file)
index 0000000..e16b5d9
--- /dev/null
@@ -0,0 +1,27 @@
+<div class="table-fit">
+    <table id="typo3-backend-user-list" class="table table-striped table-hover">
+        <thead>
+        <tr>
+            <th></th>
+            <th class="col-title"><f:translate key="userName" /> / <f:translate key="realName" /></th>
+            <th><f:translate key="lastLogin" /></th>
+            <th class="col-control"></th>
+        </tr>
+        </thead>
+        <tbody>
+        <f:for each="{paginatedBackendUsers}" as="backendUser">
+            <f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, onlineBackendUsers: onlineBackendUsers, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl, compareUserUidList: compareUserUidList}" />
+        </f:for>
+        <f:comment>
+            Footer row: no officially defined style yet
+        </f:comment>
+        </tbody>
+        <tfoot>
+        <tr>
+            <td colspan="5">
+                <f:count subject="{backendUsers}" /> <f:translate key="users" />
+            </td>
+        </tr>
+        </tfoot>
+    </table>
+</div>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidget.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidget.html
new file mode 100644 (file)
index 0000000..bf48704
--- /dev/null
@@ -0,0 +1,3 @@
+<f:be.widget.paginate objects="{backendUserGroups}" as="paginatedBackendUserGroups" configuration="{itemsPerPage: 50, insertBelow: 1}">
+    <f:render partial="BackendUserGroup/PaginatedListWidgetBody" arguments="{_all}" />
+</f:be.widget.paginate>
\ No newline at end of file
diff --git a/typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidgetBody.html b/typo3/sysext/beuser/Resources/Private/Partials/BackendUserGroup/PaginatedListWidgetBody.html
new file mode 100644 (file)
index 0000000..2982a43
--- /dev/null
@@ -0,0 +1,25 @@
+<div class="table-fit">
+    <table class="table table-striped table-hover">
+        <thead>
+        <tr>
+            <th class="col-icon"></th>
+            <th class="col-title"><f:translate key="backendUserGroup" /></th>
+            <th><f:translate key="subGroups" /></th>
+            <th class="col-control"></th>
+        </tr>
+        </thead>
+        <tbody>
+        <f:for each="{paginatedBackendUserGroups}" as="backendUserGroup">
+            <f:render partial="BackendUserGroup/IndexListRow" arguments="{demand: demand, backendUserGroup: backendUserGroup, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
+        </f:for>
+        <f:comment>
+            Footer row: no officially defined style yet
+        </f:comment>
+        <tr>
+            <td colspan="4">
+                <f:count subject="{backendUserGroups}" /> <f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:be_groups" />s
+            </td>
+        </tr>
+        </tbody>
+    </table>
+</div>
\ No newline at end of file
index 5b8b334..279f2e8 100644 (file)
        </f:comment>
        <f:render partial="Filters/BackendUser/Index" arguments="{demand: demand, backendUserGroups: backendUserGroups}" />
 
-       <f:comment>
-               Listing of all users
-       </f:comment>
-       <f:be.widget.paginate objects="{backendUsers}" as="paginatedBackendUsers" configuration="{itemsPerPage: 50, insertBelow: 1}">
-               <div class="table-fit">
-                       <table id="typo3-backend-user-list" class="table table-striped table-hover">
-                               <thead>
-                                       <tr>
-                                               <th></th>
-                                               <th class="col-title"><f:translate key="userName" /> / <f:translate key="realName" /></th>
-                                               <th><f:translate key="lastLogin" /></th>
-                                               <th class="col-control"></th>
-                                       </tr>
-                               </thead>
-                               <tbody>
-                                       <f:for each="{paginatedBackendUsers}" as="backendUser">
-                                               <f:render partial="BackendUser/IndexListRow" arguments="{demand: demand, backendUser: backendUser, onlineBackendUsers: onlineBackendUsers, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl, compareUserUidList: compareUserUidList}" />
-                                       </f:for>
-                                       <f:comment>
-                                               Footer row: no officially defined style yet
-                                       </f:comment>
-                               </tbody>
-                               <tfoot>
-                                       <tr>
-                                               <td colspan="5">
-                                                       <f:count subject="{backendUsers}" /> <f:translate key="users" />
-                                               </td>
-                                       </tr>
-                               </tfoot>
-                       </table>
-               </div>
-       </f:be.widget.paginate>
+       <f:render partial="BackendUser/PaginatedListWidget" arguments="{_all}" />
 
 </f:section>
index 98146d5..3213b04 100644 (file)
@@ -9,35 +9,6 @@
 
 <f:section name="content">
 
-       <f:comment>
-               Listing of all user groups
-       </f:comment>
-       <f:be.widget.paginate objects="{backendUserGroups}" as="paginatedBackendUserGroups" configuration="{itemsPerPage: 50, insertBelow: 1}">
-               <div class="table-fit">
-                       <table class="table table-striped table-hover">
-                               <thead>
-                                       <tr>
-                                               <th class="col-icon"></th>
-                                               <th class="col-title"><f:translate key="backendUserGroup" /></th>
-                                               <th><f:translate key="subGroups" /></th>
-                                               <th class="col-control"></th>
-                                       </tr>
-                               </thead>
-                               <tbody>
-                                       <f:for each="{paginatedBackendUserGroups}" as="backendUserGroup">
-                                               <f:render partial="BackendUserGroup/IndexListRow" arguments="{demand: demand, backendUserGroup: backendUserGroup, dateFormat: dateFormat, timeFormat: timeFormat, returnUrl: returnUrl}" />
-                                       </f:for>
-                                       <f:comment>
-                                               Footer row: no officially defined style yet
-                                       </f:comment>
-                                       <tr>
-                                               <td colspan="4">
-                                                       <f:count subject="{backendUserGroups}" /> <f:translate key="LLL:EXT:lang/Resources/Private/Language/locallang_tca.xlf:be_groups" />s
-                                               </td>
-                                       </tr>
-                               </tbody>
-                       </table>
-               </div>
-       </f:be.widget.paginate>
+       <f:render partial="BackendUserGroup/PaginatedListWidget" arguments="{_all}" />
 
 </f:section>