[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: When showing history include the namespace text

2017-12-22 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399660 )

Change subject: When showing history include the namespace text
..


When showing history include the namespace text

When user checks the history of page from talk namespace
we want to show the full title including the namespace text.
We used Title::getNSText() instead of Title::getPrefixedText()
as we want to style the namespace text differently.

Bug: T147722
Change-Id: If8fee42cc6d7382f1a403ac6882c2446f94f40b5
---
M includes/specials/SpecialMobileHistory.php
1 file changed, 10 insertions(+), 1 deletion(-)

Approvals:
  Bmansurov: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialMobileHistory.php 
b/includes/specials/SpecialMobileHistory.php
index e72dc06..1b945ea 100644
--- a/includes/specials/SpecialMobileHistory.php
+++ b/includes/specials/SpecialMobileHistory.php
@@ -65,8 +65,16 @@
 * @param Title|string $title The page to link to or a string to show
 */
protected function renderHeaderBar( $title ) {
+   $namespaceLabel = '';
if ( $title instanceof Title ) {
$headerTitle = $this->getHeaderBarLink( $title );
+
+   if ( MWNamespace::isTalk( $title->getNamespace() ) ) {
+   $namespaceLabel = Html::element( 'span',
+   [ 'class' => 'mw-mf-namespace' ],
+   $title->getNsText() . ': ' );
+   }
+
} else {
// manually style it as a userlink
$headerTitle = Html::element(
@@ -77,7 +85,8 @@
}
$this->getOutput()->addHtml(
Html::openElement( 'div', [ 'class' => 'content-header' 
] ) .
-   Html::openElement( 'h2', [] ) .
+   Html::openElement( 'h2', [ 'class' => 
'mw-mf-title-wrapper' ] ) .
+   $namespaceLabel .
$headerTitle .
Html::closeElement( 'h2' ) .
Html::closeElement( 'div' )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If8fee42cc6d7382f1a403ac6882c2446f94f40b5
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Pmiazga 
Gerrit-Reviewer: Bmansurov 
Gerrit-Reviewer: Pmiazga 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] mediawiki...MobileFrontend[master]: When showing history include the namespace text

2017-12-21 Thread Pmiazga (Code Review)
Pmiazga has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399660 )

Change subject: When showing history include the namespace text
..

When showing history include the namespace text

When user checks the history of page not from NS_MAIN namespace
we want to show the full title including the namespace text.
We used Title::getNSText() instead of Title::getPrefixedText()
as we want to style the namespace text differently.

Bug: T147722
Change-Id: If8fee42cc6d7382f1a403ac6882c2446f94f40b5
---
M includes/specials/SpecialMobileHistory.php
1 file changed, 10 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend 
refs/changes/60/399660/1

diff --git a/includes/specials/SpecialMobileHistory.php 
b/includes/specials/SpecialMobileHistory.php
index e72dc06..ed2b4b8 100644
--- a/includes/specials/SpecialMobileHistory.php
+++ b/includes/specials/SpecialMobileHistory.php
@@ -65,8 +65,16 @@
 * @param Title|string $title The page to link to or a string to show
 */
protected function renderHeaderBar( $title ) {
+   $namespaceLabel = '';
if ( $title instanceof Title ) {
$headerTitle = $this->getHeaderBarLink( $title );
+
+
+   if ( $title->getNamespace() !== NS_MAIN ) {
+   $namespaceLabel = Html::element( 'span', [ 
'class' => 'mw-mf-namespace'],
+   $title->getNsText() . ': ');
+   }
+
} else {
// manually style it as a userlink
$headerTitle = Html::element(
@@ -77,7 +85,8 @@
}
$this->getOutput()->addHtml(
Html::openElement( 'div', [ 'class' => 'content-header' 
] ) .
-   Html::openElement( 'h2', [] ) .
+   Html::openElement( 'h2', [ 'class' => 
'mw-mf-title-wrapper' ] ) .
+   $namespaceLabel .
$headerTitle .
Html::closeElement( 'h2' ) .
Html::closeElement( 'div' )

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: If8fee42cc6d7382f1a403ac6882c2446f94f40b5
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Pmiazga 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits