From 6ef18747852a8f9eeca0c061df41cba1aab04043 Mon Sep 17 00:00:00 2001
From: Georg Ringer <georg.ringer@gmail.com>
Date: Wed, 20 Jun 2018 19:15:30 +0200
Subject: [PATCH] [BUGFIX] Avoid prev/next arrows if only 1 system news is
 shown

If only one system news is shown, it makes no sense to render arrows
to switch to other news records. Therefore those should only be
shown if there are at least 2 records.

Resolves: #85322
Releases: master, 8.7
Change-Id: I636b90121729bb2f12c2313a3cb7e8b858367970
Reviewed-on: https://review.typo3.org/57275
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Riccardo De Contardi <erredeco@gmail.com>
Reviewed-by: Guido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Nicole Cordes <typo3@cordes.co>
Tested-by: Nicole Cordes <typo3@cordes.co>
---
 .../Resources/Private/Partials/LoginNews.html      | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/typo3/sysext/backend/Resources/Private/Partials/LoginNews.html b/typo3/sysext/backend/Resources/Private/Partials/LoginNews.html
index 7b677c9f768a..d7565109648e 100644
--- a/typo3/sysext/backend/Resources/Private/Partials/LoginNews.html
+++ b/typo3/sysext/backend/Resources/Private/Partials/LoginNews.html
@@ -9,13 +9,15 @@
 				</div>
 			</f:for>
 		</div>
-		<a class="left typo3-login-carousel-control" href="#loginNews" role="button" data-slide="prev">
+		<f:if condition="{loginNewsItems -> f:count()} > 1">
+			<a class="left typo3-login-carousel-control" href="#loginNews" role="button" data-slide="prev">
 			<i class="fa fa-angle-left"></i>
 			<span class="sr-only"><f:translate key="login.news.previous" /></span>
-		</a>
-		<a class="right typo3-login-carousel-control" href="#loginNews" role="button" data-slide="next">
-			<i class="fa fa-angle-right"></i>
-			<span class="sr-only"><f:translate key="login.news.next" /></span>
-		</a>
+			</a>
+			<a class="right typo3-login-carousel-control" href="#loginNews" role="button" data-slide="next">
+				<i class="fa fa-angle-right"></i>
+				<span class="sr-only"><f:translate key="login.news.next" /></span>
+			</a>
+		</f:if>
 	</div>
 </f:if>
-- 
GitLab