From 3f2b9385548857ab12b6117912e7c902cc96d02f Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Wed, 27 Mar 2019 11:31:39 -0700 Subject: [PATCH] Annotate different parts of the contributions UI with classes Distinguish the user tools (talk, block, block log etc) from the pager navigation navigation bar so that skins can style them. Change-Id: I32950aa452347aabb8a37253bafc5f20d518c110 --- includes/specials/SpecialContributions.php | 8 +++++--- includes/specials/pagers/ContribsPager.php | 13 +++++++++++++ 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/includes/specials/SpecialContributions.php b/includes/specials/SpecialContributions.php index c0303b255c..f60d5f02db 100644 --- a/includes/specials/SpecialContributions.php +++ b/includes/specials/SpecialContributions.php @@ -244,9 +244,9 @@ class SpecialContributions extends IncludableSpecialPage { $output = $pager->getBody(); if ( !$this->including() ) { - $output = '

' . $pager->getNavigationBar() . '

' . + $output = $pager->getNavigationBar() . $output . - '

' . $pager->getNavigationBar() . '

'; + $pager->getNavigationBar(); } $out->addHTML( $output ); } @@ -353,7 +353,9 @@ class SpecialContributions extends IncludableSpecialPage { } } - return $this->msg( 'contribsub2' )->rawParams( $user, $links )->params( $userObj->getName() ); + return Html::rawElement( 'div', [ 'class' => 'mw-contributions-user-tools' ], + $this->msg( 'contribsub2' )->rawParams( $user, $links )->params( $userObj->getName() ) + ); } /** diff --git a/includes/specials/pagers/ContribsPager.php b/includes/specials/pagers/ContribsPager.php index 382ba2fd2b..626fc48c00 100644 --- a/includes/specials/pagers/ContribsPager.php +++ b/includes/specials/pagers/ContribsPager.php @@ -154,6 +154,19 @@ class ContribsPager extends RangeChronologicalPager { return $query; } + /** + * Wrap the navigation bar in a p element with identifying class. + * In future we may want to change the `p` tag to a `div` and upstream + * this to the parent class. + * + * @return string HTML + */ + function getNavigationBar() { + return Html::rawElement( 'p', [ 'class' => 'mw-pager-navigation-bar' ], + parent::getNavigationBar() + ); + } + /** * This method basically executes the exact same code as the parent class, though with * a hook added, to allow extensions to add additional queries. -- 2.20.1