Foxtrott has submitted this change and it was merged. Change subject: Add support for Page status indicators ......................................................................
Add support for Page status indicators Change-Id: I3bd1dfe942f284784a5ede9d7ba8a86ed3136968 --- M docs/release-notes.md M resources/styles/screen.less M src/Components/MainContent.php 3 files changed, 59 insertions(+), 5 deletions(-) Approvals: Foxtrott: Verified; Looks good to me, approved jenkins-bot: Verified diff --git a/docs/release-notes.md b/docs/release-notes.md index 4d3fbfb..b70390b 100644 --- a/docs/release-notes.md +++ b/docs/release-notes.md @@ -8,6 +8,8 @@ * Add URL parameter 'uselayout' * Add attributes 'showTools' and 'showLanguages' for the NavMenu * Add attributes 'hideTools' and 'hideLanguages' for the ToolbarHorizontal +* Add support for [Page status indicators] + (https://www.mediawiki.org/wiki/Help:Page_status_indicators) Fixes: * Correctly follow symlinks diff --git a/resources/styles/screen.less b/resources/styles/screen.less index dd47aef..bcbe04c 100644 --- a/resources/styles/screen.less +++ b/resources/styles/screen.less @@ -416,3 +416,16 @@ .mw-headline-anchor { display: none; } + +.mw-indicators { + float: right; + line-height: 1.6; + font-size: @font-size-small; + position: relative; + z-index: 1; + + .mw-indicator { + display: inline-block; + } +} + diff --git a/src/Components/MainContent.php b/src/Components/MainContent.php index ca64fe9..508fb3f 100644 --- a/src/Components/MainContent.php +++ b/src/Components/MainContent.php @@ -60,6 +60,7 @@ ) . $idRegistry->element( 'a', array( 'id' => 'top' ) ) . + $this->indent(1) . $idRegistry->element( 'div', array( 'id' => 'mw-indicators', 'class' => 'mw-indicators', ), $this->buildMwIndicators() ) . $this->indent() . '<div ' . \Html::expandAttributes( array( 'id' => $idRegistry->getId( 'mw-js-message' ), @@ -71,7 +72,7 @@ $ret .= $this->buildContentBody(); $ret .= $this->buildCategoryLinks(); - $ret .= $this->indent( -1 ) . '</div>' . "\n"; + $ret .= $this->indent( -1 ) . '</div>'; // END content return $ret; @@ -85,7 +86,7 @@ $skintemplate = $this->getSkinTemplate(); $idRegistry = IdRegistry::getRegistry(); - $ret = $this->indent( 1 ) . '<div class ="contentHeader">' . + $ret = $this->indent() . '<div class ="contentHeader">' . $this->indent( 1 ) . '<!-- title of the page -->' . $this->indent() . $idRegistry->element( 'h1', array( 'id' => 'firstHeading', 'class' => 'firstHeading' ), $skintemplate->get( 'title' ) ) . @@ -123,10 +124,12 @@ * @return string */ protected function buildContentBody() { - return IdRegistry::getRegistry()->element( 'div', array( 'id' => 'bodyContent' ), - $this->indent() . '<!-- body text -->' . "\n" . + return $this->indent() . IdRegistry::getRegistry()->element( 'div', array( 'id' => 'bodyContent' ), + $this->indent( 1 ) . '<!-- body text -->' . "\n" . $this->indent() . $this->getSkinTemplate()->get( 'bodytext' ) . - $this->buildDataAfterContent() + $this->indent() . '<!-- end body text -->' . + $this->buildDataAfterContent() . + $this->indent( -1 ) ); } @@ -158,4 +161,40 @@ return ''; } + + /** + * @return string + */ + private function buildMwIndicators() { + + $idRegistry = IdRegistry::getRegistry(); + $indicators = $this->getSkinTemplate()->get( 'indicators' ); + + if ( !is_array( $indicators ) || count( $indicators ) === 0 ) { + return ''; + } + + $this->indent( 1 ); + + $ret = ''; + + foreach ( $indicators as $id => $content ) { + $id = \Sanitizer::escapeId( "mw-indicator-$id" ); + + $ret .= + $this->indent() . + $idRegistry->element( 'div', + array( + 'id' => $id, + 'class' => "mw-indicator $id", + ), + $content + ); + } + + $ret .= $this->indent( -1 ); + + return $ret; + } + } -- To view, visit https://gerrit.wikimedia.org/r/274009 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I3bd1dfe942f284784a5ede9d7ba8a86ed3136968 Gerrit-PatchSet: 4 Gerrit-Project: mediawiki/skins/chameleon Gerrit-Branch: master Gerrit-Owner: Foxtrott <s7ep...@gmail.com> Gerrit-Reviewer: Foxtrott <s7ep...@gmail.com> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits