From b2dab1611fe7eb3888ffec3a860827c22946fa40 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Arroyo?= Date: Fri, 4 Apr 2025 14:57:25 +0200 Subject: contributions: Use CSS classes for user links Why: - Currently, the list of changes provided by ContributionsPager has links to user pages that start with a separator, then followed by a link to the user page, then followed by a link to the user talk page. - For each row, the link to the user talk page is wrapped in parenthesis by explicitly adding them to the HTML code. However, that doesn't work as expected when using the the Minerva skin: The CSS rules for that skin make the link to be shown out of the parenthesis. - Moreover, the different parts of each line do not provide CSS classes indicating their semantic meaning, making it difficult for skins to modify their appearance. What: - Stop providing the parenthesis as part of the HTML output, replacing them by the usage of semantic CSS classes 'mw-usertoollinks', 'mw-changeslist-links' and 'mw-usertoollinks-talk'. Bug: T389478 Change-Id: I44cc510eb37458b03c217b91f24eeaa8866e6cfd --- includes/pager/ContributionsPager.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/includes/pager/ContributionsPager.php b/includes/pager/ContributionsPager.php index ebd1efa87869..fdebeb41f92e 100644 --- a/includes/pager/ContributionsPager.php +++ b/includes/pager/ContributionsPager.php @@ -920,12 +920,14 @@ abstract class ContributionsPager extends RangeChronologicalPager { $revUserId = $revUser ? $revUser->getId() : 0; $revUserText = $revUser ? $revUser->getName() : ''; if ( $this->target !== $revUserText ) { - $userlink = ' ' - . Html::rawElement( 'bdi', [ 'dir' => $dir ], - Linker::userLink( $revUserId, $revUserText ) ); - $userlink .= ' ' . $this->msg( 'parentheses' )->rawParams( - Linker::userTalkLink( $revUserId, $revUserText ) )->escaped() . ' '; + $userPageLink = Linker::userLink( $revUserId, $revUserText ); + $userTalkLink = Linker::userTalkLink( $revUserId, $revUserText ); + + $userlink = ' ' . + Html::rawElement( 'bdi', [ 'dir' => $dir ], $userPageLink ) . + Linker::renderUserToolLinksArray( [ $userTalkLink ], false ); } + return $userlink; } -- cgit v1.2.3