From a0e02da71f1696ab4790954720160cc2bd9690d6 Mon Sep 17 00:00:00 2001 From: Moriel Schottlender Date: Fri, 26 Aug 2016 14:49:10 -0700 Subject: [PATCH] Style changes for unwatch actions - Reverse 'watch' / 'unwatch' star icons - Truncate title texts - Minor indentation fix Bug: T132975 Change-Id: I1dbd6d1480f6ef5a45184271c932cd27258f7424 --- includes/formatters/EventPresentationModel.php | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/includes/formatters/EventPresentationModel.php b/includes/formatters/EventPresentationModel.php index 3843ca6dc..e02f437ca 100644 --- a/includes/formatters/EventPresentationModel.php +++ b/includes/formatters/EventPresentationModel.php @@ -631,7 +631,7 @@ abstract class EchoEventPresentationModel implements JsonSerializable { 'description' => $this ->msg( 'notification-dynamic-actions-' . $availableAction . '-confirmation-description' ) ->params( - $title->getPrefixedText(), + $this->getTruncatedTitleText( $title ), $title->getFullURL() ), ), @@ -645,14 +645,19 @@ abstract class EchoEventPresentationModel implements JsonSerializable { return $this->getDynamicActionLink( $title, - $isTitleWatched ? 'unStar' : 'star', + // Design requirements are to flip the star icons + // in their meaning; that is, for the 'unwatch' action + // we should display an empty star, and for the 'watch' + // action a full star. In OOUI icons, their names + // are reversed. + $isTitleWatched ? 'star' : 'unStar', // notification-dynamic-actions-watch // notification-dynamic-actions-unwatch $this->msg( 'notification-dynamic-actions-' . $availableAction ) - ->params( - $title->getPrefixedText(), - $title->getFullURL( array( 'action' => $availableAction ) ) - ), + ->params( + $this->getTruncatedTitleText( $title ), + $title->getFullURL( array( 'action' => $availableAction ) ) + ), null, $data, array( 'action' => $availableAction )