Skip to content

Commit

Permalink
[TASK] Streamline backend user/-group total amount output
Browse files Browse the repository at this point in the history
Streamline total amount text for backend groups and backend
user listing. Also correct wording is applied, depending on
the number of records displayed.

Resolves: #99966
Releases: main, 12.4
Change-Id: Ie96dfc1148d4eafcc4418b7187645bf4831262f3
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/77874
Tested-by: core-ci <typo3@b13.com>
Tested-by: Benni Mack <benni@typo3.org>
Reviewed-by: Benni Mack <benni@typo3.org>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Tested-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Jochen <rothjochen@gmail.com>
  • Loading branch information
josefglatz authored and bmack committed Jul 5, 2023
1 parent 23b50fc commit ae67fc4
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
12 changes: 9 additions & 3 deletions typo3/sysext/beuser/Resources/Private/Language/locallang.xlf
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2">
<file source-language="en" datatype="plaintext" original="EXT:beuser/Resources/Private/Language/locallang.xlf" date="2012-07-16T10:11:32Z" product-name="beuser">
<file source-language="en" datatype="plaintext" original="EXT:beuser/Resources/Private/Language/locallang.xlf" date="2023-02-15T18:03:32Z" product-name="beuser">
<header/>
<body>
<trans-unit id="activeSessions" resname="activeSessions">
Expand Down Expand Up @@ -36,6 +36,9 @@
<trans-unit id="users" resname="users">
<source>Users</source>
</trans-unit>
<trans-unit id="user" resname="user">
<source>User</source>
</trans-unit>
<trans-unit id="yes" resname="yes">
<source>Yes</source>
</trans-unit>
Expand Down Expand Up @@ -213,6 +216,9 @@
<trans-unit id="groups" resname="groups">
<source>Groups</source>
</trans-unit>
<trans-unit id="group" resname="group">
<source>Group</source>
</trans-unit>
<trans-unit id="information.groups.direct" resname="information.groups.direct">
<source>Directly assigned</source>
</trans-unit>
Expand Down Expand Up @@ -339,10 +345,10 @@
<source>Storage</source>
</trans-unit>
<trans-unit id="filemount.amount.multiple" resname="filemount.amount.multiple">
<source>%s filemounts</source>
<source>%s Filemounts</source>
</trans-unit>
<trans-unit id="filemount.amount.singular" resname="filemount.amount.singular">
<source>1 filemount</source>
<source>1 Filemount</source>
</trans-unit>
</body>
</file>
Expand Down
Expand Up @@ -143,13 +143,14 @@
<tfoot>
<tr>
<td colspan="5">
{totalAmountOfBackendUsers} <f:translate key="users" />
<f:if condition="{totalAmountOfBackendUsers} > 1">
<f:then>{totalAmountOfBackendUsers} <f:translate key="users" /></f:then>
<f:else>{totalAmountOfBackendUsers} <f:translate key="user" /></f:else>
</f:if>
</td>
</tr>
</tfoot>
</table>
</div>

<f:render partial="SimplePagination" arguments="{paginator:paginator, pagination:pagination}" />

</html>
Expand Up @@ -110,7 +110,10 @@
<tfoot>
<tr>
<td colspan="4">
{totalAmountOfBackendUserGroups} <f:translate key="LLL:EXT:core/Resources/Private/Language/locallang_tca.xlf:be_groups" />
<f:if condition="{totalAmountOfBackendUserGroups} > 1">
<f:then>{totalAmountOfBackendUserGroups} <f:translate key="groups" /></f:then>
<f:else>{totalAmountOfBackendUserGroups} <f:translate key="group" /></f:else>
</f:if>
</td>
</tr>
</tfoot>
Expand Down
Expand Up @@ -78,6 +78,17 @@ <h1><f:translate key="onlineUsers" /></h1>
</f:for>
</f:for>
</tbody>
<tfoot>
<tr>
<td colspan="5">
<f:variable name="onlineUsersAndSessionsCount">{onlineUsersAndSessions -> f:count()}</f:variable>
<f:if condition="{onlineUsersAndSessionsCount} > 1">
<f:then>{onlineUsersAndSessionsCount} <f:translate key="users" /></f:then>
<f:else>{onlineUsersAndSessionsCount} <f:translate key="user" /></f:else>
</f:if>
</td>
</tr>
</tfoot>
</table>
</div>

Expand Down
Expand Up @@ -190,7 +190,7 @@ private function checkCountOfUsers(ApplicationTester $I, int $countOfUsers): voi
$I->canSeeNumberOfElements('#typo3-backend-user-list tbody tr', $countOfUsers);
$I->wantToTest('If a number of users is shown in the footer row');
$I->canSeeNumberOfElements('#typo3-backend-user-list tfoot tr', 1);
$I->see($countOfUsers . ' Users', '#typo3-backend-user-list tfoot tr');
$I->see($countOfUsers . ' User', '#typo3-backend-user-list tfoot tr');
}

private function openAndCloseTheEditForm(ApplicationTester $I, string $username): void
Expand Down

0 comments on commit ae67fc4

Please sign in to comment.