Robmoen has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/235904

Change subject: Promote beta last-modified-bar work to stable
......................................................................

Promote beta last-modified-bar work to stable

- Last modified bar is now on the bottom of the page
- Eliminate no longer needed methods from MinervaTemplate.php
- Remove modified bar location specific classes from template

Note: tablet styles for .last-modified-bar.pre-content to be
removed when cache clears.

Bug: T104697
Change-Id: I2e2259f381e42944106b9b2972fd83b37acd1ead
---
M includes/skins/MinervaTemplate.php
M includes/skins/MinervaTemplateBeta.php
M includes/skins/history.mustache
M resources/skins.minerva.content.styles/links.less
M resources/skins.minerva.tablet.beta.styles/ui.less
M resources/skins.minerva.tablet.styles/common.less
6 files changed, 38 insertions(+), 71 deletions(-)


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

diff --git a/includes/skins/MinervaTemplate.php 
b/includes/skins/MinervaTemplate.php
index fdf2112..7abee82 100644
--- a/includes/skins/MinervaTemplate.php
+++ b/includes/skins/MinervaTemplate.php
@@ -7,9 +7,6 @@
  * Extended Template class of BaseTemplate for mobile devices
  */
 class MinervaTemplate extends BaseTemplate {
-       /** @var boolean Temporary variable that decides whether
-        * history link should be rendered before the content. */
-       protected $renderHistoryLinkBeforeContent = true;
        /** @var string $searchPlaceHolderMsg Message used as placeholder in 
search input */
        protected $searchPlaceHolderMsg = 'mobile-frontend-placeholder';
 
@@ -168,32 +165,6 @@
        }
 
        /**
-        * Gets history link at top of page if it isn't the main page
-        * @param array $data Data used to build the page
-        * @return string
-        */
-       protected function getHistoryLinkTopHtml( $data ) {
-               if ( !$this->isMainPage ) {
-                       return $this->getHistoryLinkHtml( $data );
-               } else {
-                       return '';
-               }
-       }
-
-       /**
-        * Gets history link at bottom of page if it is the main page
-        * @param array $data Data used to build the page
-        * @return string
-        */
-       protected function getHistoryLinkBottomHtml( $data ) {
-               if ( $this->isMainPage ) {
-                       return $this->getHistoryLinkHtml( $data );
-               } else {
-                       return '';
-               }
-       }
-
-       /**
         * Get page secondary actions
         */
        protected function getSecondaryActions() {
@@ -254,15 +225,16 @@
                                'lang' => $data['pageLang'],
                                'dir' => $data['pageDir'],
                        ) );
-                       ?>
-                       <?php
-                               echo $data[ 'bodytext' ];
-                               if ( isset( $data['subject-page'] ) ) {
-                                       echo $data['subject-page'];
-                               }
-                               echo $this->getPostContentHtml( $data );
-                               echo $this->getSecondaryActionsHtml();
-                               echo $this->getHistoryLinkBottomHtml( $data );
+                       echo $data[ 'bodytext' ];
+                       if ( isset( $data['subject-page'] ) ) {
+                               echo $data['subject-page'];
+                       }
+                       echo $this->getPostContentHtml( $data );
+                       echo $this->getSecondaryActionsHtml();
+                       // History link on the bottom of the main page
+                       if ( $this->isMainPage ) {
+                               echo $this->getHistoryLinkHtml( $data );
+                       }
                        ?>
                        </div>
                        <?php
@@ -316,17 +288,14 @@
         * @param array $data Data used to build the page
         */
        protected function renderContentWrapper( $data ) {
-               if ( $this->renderHistoryLinkBeforeContent ) {
-                       echo $this->getHistoryLinkTopHtml( $data );
-                       echo $this->makeInlineMobileHeadEmitScript( 
'history-link-loaded' );
-               }
                echo $this->makeInlineMobileHeadEmitScript( 'header-loaded' );
                $this->renderPreContent( $data );
                $this->renderContent( $data );
-               if ( !$this->renderHistoryLinkBeforeContent ) {
-                       echo $this->getHistoryLinkTopHtml( $data );
-                       echo $this->makeInlineMobileHeadEmitScript( 
'history-link-loaded' );
+               // Last modified bar at the top of the article
+               if ( !$this->isMainPage ) {
+                       echo $this->getHistoryLinkHtml( $data );
                }
+               echo $this->makeInlineMobileHeadEmitScript( 
'history-link-loaded' );
        }
 
        /**
diff --git a/includes/skins/MinervaTemplateBeta.php 
b/includes/skins/MinervaTemplateBeta.php
index 1fbf4b0..8e12f81 100644
--- a/includes/skins/MinervaTemplateBeta.php
+++ b/includes/skins/MinervaTemplateBeta.php
@@ -8,8 +8,6 @@
  * beta mode via Special:MobileOptions
  */
 class MinervaTemplateBeta extends MinervaTemplate {
-       /** {@inheritdoc} */
-       protected $renderHistoryLinkBeforeContent = false;
        /**
         * @var string $searchPlaceHolderMsg Message used as placeholder in 
search input
         */
diff --git a/includes/skins/history.mustache b/includes/skins/history.mustache
index 47cc874..b447072d 100644
--- a/includes/skins/history.mustache
+++ b/includes/skins/history.mustache
@@ -1,5 +1,4 @@
-{{! FIXME: Remove .pre-content when the last modified bar in beta is promoted 
to stable }}
-{{^isMainPage}}<div class="last-modified-bar view-border-box pre-content 
post-content">{{/isMainPage}}
+{{^isMainPage}}<div class="last-modified-bar view-border-box">{{/isMainPage}}
        <div id="mw-mf-last-modified" class="truncated-text">
                <a href="{{link}}"
                        data-user-name="{{username}}"
diff --git a/resources/skins.minerva.content.styles/links.less 
b/resources/skins.minerva.content.styles/links.less
index c6d2a28..39ad509 100644
--- a/resources/skins.minerva.content.styles/links.less
+++ b/resources/skins.minerva.content.styles/links.less
@@ -35,8 +35,7 @@
 
 .content {
        // Generic class name needed
-       .return-link,
-       #mw-mf-last-modified {
+       .return-link {
                display: block;
                font-size: .9em;
                margin-top: 1.5em;
diff --git a/resources/skins.minerva.tablet.beta.styles/ui.less 
b/resources/skins.minerva.tablet.beta.styles/ui.less
index c2f3b82..8a9378c 100644
--- a/resources/skins.minerva.tablet.beta.styles/ui.less
+++ b/resources/skins.minerva.tablet.beta.styles/ui.less
@@ -2,24 +2,4 @@
 @import "mediawiki.ui/variables";
 
 @media all and (min-width: @wgMFDeviceWidthTablet) {
-       .last-modified-bar.post-content {
-               background-color: transparent;
-               padding-left: 0;
-               padding-right: 0;
-               font-size: 1em;
-               &.active {
-                       background-color: transparent;
-                       #mw-mf-last-modified {
-                               background-color: 
@lastModifiedBarActiveBackgroundColor;
-                       }
-               }
-
-               // This rule must be scoped to .last-modified-bar to prevent 
side effects on the MainPage bar
-               #mw-mf-last-modified {
-                       background-color: @colorGray14;
-                       font-size: 0.9em;
-                       padding-left: 16px;
-                       padding-right: 16px;
-               }
-       }
 }
diff --git a/resources/skins.minerva.tablet.styles/common.less 
b/resources/skins.minerva.tablet.styles/common.less
index d42b66c..1e403d2 100644
--- a/resources/skins.minerva.tablet.styles/common.less
+++ b/resources/skins.minerva.tablet.styles/common.less
@@ -115,6 +115,7 @@
                        padding-top: 0;
                        padding-bottom: 0;
                }
+               // FIXME: remove when cache clears
                .last-modified-bar.pre-content {
                        max-width: none;
                        padding: 0 16px;
@@ -128,4 +129,25 @@
        #mw-mf-last-modified {
                padding: 5px 0;
        }
+
+       .last-modified-bar {
+               background-color: transparent;
+               padding-left: 0;
+               padding-right: 0;
+               font-size: 1em;
+               &.active {
+                       background-color: transparent;
+                       #mw-mf-last-modified {
+                               background-color: 
@lastModifiedBarActiveBackgroundColor;
+                       }
+               }
+
+               // This rule must be scoped to .last-modified-bar to prevent 
side effects on the MainPage bar
+               #mw-mf-last-modified {
+                       background-color: @colorGray14;
+                       font-size: 0.9em;
+                       padding-left: 16px;
+                       padding-right: 16px;
+               }
+       }
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e2259f381e42944106b9b2972fd83b37acd1ead
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Robmoen <rm...@wikimedia.org>

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

Reply via email to