Mattflaschen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/63256


Change subject: Add a class to PersonalTools to show (un)read notifications.
......................................................................

Add a class to PersonalTools to show (un)read notifications.

Bug: 48165
Change-Id: I01c81ad70a6029042cf5873b912f5d9343e88516
---
M Hooks.php
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Echo 
refs/changes/56/63256/1

diff --git a/Hooks.php b/Hooks.php
index 6eed01a..3a054b8 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -610,9 +610,10 @@
                }
 
                $notificationCount = 
EchoNotificationController::getNotificationCount( $wgUser );
+               $isCountZero = $notificationCount == 0;
                if ( $wgEchoShowFullNotificationsLink ) {
                        // Add a "Notifications" item to personal URLs
-                       $msg = wfMessage( $notificationCount == 0 ? 'echo-link' 
: 'echo-link-new' );
+                       $msg = wfMessage( $isCountZero ? 'echo-link' : 
'echo-link-new' );
                        $text = $msg->params( 
EchoNotificationController::formatNotificationCount( $notificationCount ) 
)->text();
                } else {
                        // Just add a number
@@ -624,6 +625,7 @@
                        'href' => $url,
                        'text' => $text,
                        'active' => ( $url == $title->getLocalUrl() ),
+                       'class' => $isCountZero ? 
'mw-echo-no-unread-notifications' : 'mw-echo-unread-notifications',
                );
 
                $insertUrls = array( 'notifications' => $notificationsLink );

-- 
To view, visit https://gerrit.wikimedia.org/r/63256
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I01c81ad70a6029042cf5873b912f5d9343e88516
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Echo
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to