jenkins-bot has submitted this change and it was merged.

Change subject: Story 964: Move Echo to stable
......................................................................


Story 964: Move Echo to stable

Add is-authenticated class to body tag for logged in users
* Hide echo button when not logged in
** Drop the echo log in cta
* Customise Notifications special page for mobile to add a return to link
at top of page
* Move css to stable

Change-Id: Id5ea7a54546fa166fd3ee3d9bb22ca1ab725cffe
---
M MobileFrontend.i18n.php
M MobileFrontend.php
M includes/MobileFrontend.hooks.php
M includes/Resources.php
M includes/skins/SkinMinerva.php
M includes/skins/SkinMobile.php
A includes/specials/SpecialMobileNotifications.php
D javascripts/common/user.js
M less/common/ui.less
D less/common/user.less
M stylesheets/common/ui.css
D stylesheets/common/user.css
12 files changed, 91 insertions(+), 98 deletions(-)

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



diff --git a/MobileFrontend.i18n.php b/MobileFrontend.i18n.php
index 7b31651..d5b3fec 100644
--- a/MobileFrontend.i18n.php
+++ b/MobileFrontend.i18n.php
@@ -122,7 +122,6 @@
        'mobile-frontend-ajax-preview-loading' => 'Loading page preview',
        'mobile-frontend-page-saving' => 'Saving $1',
 
-       'mobile-frontend-user-cta' => 'Please login or sign up to see your 
notifications.',
        'mobile-frontend-user-button-tooltip' => 'Show my notifications',
 
        // nearby overlay
diff --git a/MobileFrontend.php b/MobileFrontend.php
index 0be15c3..c6e8eec 100644
--- a/MobileFrontend.php
+++ b/MobileFrontend.php
@@ -62,6 +62,7 @@
        'SpecialMobileMenu' => 'specials/SpecialMobileMenu',
        'SpecialMobileWatchlist' => 'specials/SpecialMobileWatchlist',
        'SpecialNearby' => 'specials/SpecialNearby',
+       'SpecialMobileNotifications' => 'specials/SpecialMobileNotifications',
        'MobileSpecialPage' => 'specials/MobileSpecialPage',
 
        'MinervaTemplate' => 'skins/MinervaTemplate',
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index bc2da6b..214f2a7 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -272,6 +272,10 @@
                        // FIXME: Make uploads work on desktop
                        $list['Uploads'] = 'SpecialUploads';
                        $list['Userlogin'] = 'SpecialMobileUserlogin';
+
+                       if ( class_exists( 'MWEchoNotifUser' ) ) {
+                               $list['Notifications'] = 
'SpecialMobileNotifications';
+                       }
                }
                return true;
        }
diff --git a/includes/Resources.php b/includes/Resources.php
index 01fb010..9f7409b 100644
--- a/includes/Resources.php
+++ b/includes/Resources.php
@@ -121,13 +121,6 @@
                'position' => 'top',
        ),
 
-       'mobile.styles.beta' => $wgMFMobileResourceBoilerplate + array(
-               'styles' => array(
-                       'stylesheets/common/user.css',
-               ),
-               'position' => 'top',
-       ),
-
        // Important: This module is loaded on both mobile and desktop skin
        'mobile.head' => $wgMFMobileResourceBoilerplate + array(
                'scripts' => array(
@@ -277,7 +270,6 @@
                        'javascripts/modules/mf-toggle-dynamic.js',
                        'javascripts/modules/talk/TalkSectionOverlay.js',
                        'javascripts/modules/talk.js',
-                       'javascripts/common/user.js',
                        'javascripts/modules/search/pageImages.js',
                        'javascripts/modules/languages/preferred.js',
                        'javascripts/modules/tutorials/PageActionOverlay.js',
@@ -307,9 +299,6 @@
                        'mobile-frontend-talk-reply-success',
                        'mobile-frontend-talk-reply',
                        'mobile-frontend-talk-reply-info',
-
-                       // user.js
-                       'mobile-frontend-user-cta',
                ),
        ),
 
diff --git a/includes/skins/SkinMinerva.php b/includes/skins/SkinMinerva.php
index dd16d92..61b685c 100644
--- a/includes/skins/SkinMinerva.php
+++ b/includes/skins/SkinMinerva.php
@@ -35,7 +35,7 @@
                        $tpl->set( 'userButton',
                                Html::openElement( 'a', array(
                                        'title' => wfMessage( 
'mobile-frontend-user-button-tooltip' ),
-                                       'href' => SpecialPage::getTitleFor( 
'Notifications' )->getLocalURL(),
+                                       'href' => SpecialPage::getTitleFor( 
'Notifications' )->getLocalURL( array( 'returnto' => 
$this->getTitle()->getPrefixedText() ) ),
                                        'id'=> 'user-button',
                                ) ) .
                                Html::element( 'span', array( 'class' => $count 
? '' : 'zero' ), $count ) .
diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 1d70f55..b86b371 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -18,6 +18,9 @@
                $this->setContext( $context );
                $this->addPageClass( 'mobile' );
                $this->addPageClass( $this->getMode() );
+               if ( !$this->getUser()->isAnon() ) {
+                       $this->addPageClass( 'is-authenticated' );
+               }
        }
 
        public function outputPage( OutputPage $out = null ) {
diff --git a/includes/specials/SpecialMobileNotifications.php 
b/includes/specials/SpecialMobileNotifications.php
new file mode 100644
index 0000000..f8f2d9f
--- /dev/null
+++ b/includes/specials/SpecialMobileNotifications.php
@@ -0,0 +1,19 @@
+<?php
+
+// FIXME: This should be upstreamed to Echo extension after some design 
treatment for desktop version
+
+class SpecialMobileNotifications extends SpecialNotifications {
+       public function execute( $par ) {
+               $out = $this->getOutput();
+               $title = $out->getRequest()->getText( 'returnto' );
+               if ( $title ) {
+                       $title = Title::newFromText( $title );
+                       $out->addHtml(
+                               Html::openElement( 'p' ) .
+                               Html::element( 'a', array( 'href' => 
$title->getLocalUrl() ), wfMessage( 'returnto', $title->getText() ) ) .
+                               Html::closeElement( 'p' )
+                       );
+               }
+               parent::execute( $par );
+       }
+}
diff --git a/javascripts/common/user.js b/javascripts/common/user.js
deleted file mode 100644
index 0ccfa86..0000000
--- a/javascripts/common/user.js
+++ /dev/null
@@ -1,15 +0,0 @@
-( function( M, $ ) {
-       var CtaDrawer = M.require( 'CtaDrawer' ), drawer;
-
-       if ( !M.isLoggedIn() ) {
-               drawer = new CtaDrawer( {
-                       content: mw.msg( 'mobile-frontend-user-cta' )
-               } );
-
-               // FIXME change when micro.tap.js in stable
-               $( '#user-button' ).on( mw.config.get( 'wgMFMode' ) === 'alpha' 
? 'tap' : 'click', function( ev ) {
-                       ev.preventDefault();
-                       drawer.show();
-               } );
-       }
-}( mw.mobileFrontend, jQuery ) );
diff --git a/less/common/ui.less b/less/common/ui.less
index f9f6720..3c95fac 100644
--- a/less/common/ui.less
+++ b/less/common/ui.less
@@ -15,17 +15,12 @@
        min-height: @headerHeight;
        overflow: hidden;
        position: relative;
-       padding: 0 @searchBarPaddingRight 0 @searchBarPaddingLeft;
+       padding: 0 10px 0 @searchBarPaddingLeft;
 
        h1, h2 {
                font-size: @baseFontSize * 1.6;
                margin: round( @headerHeight*0.22 ) 0 0;
        }
-}
-
-// FIXME: Delete when Echo moves to stable
-.stable .header {
-       padding-right: 10px;
 }
 
 /* Menu buttons */
@@ -39,9 +34,38 @@
        top: 0;
 }
 
-// FIXME: hide Echo Notifications button in stable
-.stable #user-button {
+/* Echo Notifications */
+.is-authenticated {
+       .header {
+               padding-right: @searchBarPaddingRight;
+       }
+       #user-button {
+               display: block;
+       }
+}
+
+#user-button {
        display: none;
+       right: 0;
+       background: url(images/user.png) 50% 50% no-repeat;
+       .background-size( auto, 24px );
+
+       span {
+               position: absolute;
+               right: 5px;
+               bottom: 7px;
+               font-size: .8em;
+               font-weight: bold;
+               color: #fff;
+               line-height: 1;
+               padding: 1px 4px;
+               background: #c91f2c;
+               border-radius: 3px;
+
+               &.zero {
+                       display: none;
+               }
+       }
 }
 
 /* hamburger */
diff --git a/less/common/user.less b/less/common/user.less
deleted file mode 100644
index 655797f..0000000
--- a/less/common/user.less
+++ /dev/null
@@ -1,26 +0,0 @@
-// FIXME: merge with navigation when notifications in stable
-@import '../mixins.less';
-
-#user-button {
-       right: 0;
-       background: url(images/user.png) 50% 50% no-repeat;
-       .background-size( auto, 24px );
-
-       span {
-               position: absolute;
-               right: 5px;
-               bottom: 7px;
-               font-size: .8em;
-               font-weight: bold;
-               color: #fff;
-               line-height: 1;
-               padding: 1px 4px;
-               background: #c91f2c;
-               border-radius: 3px;
-
-               &.zero {
-                       display: none;
-               }
-       }
-}
-
diff --git a/stylesheets/common/ui.css b/stylesheets/common/ui.css
index 8886831..c394a26 100644
--- a/stylesheets/common/ui.css
+++ b/stylesheets/common/ui.css
@@ -329,15 +329,12 @@
   min-height: 46px;
   overflow: hidden;
   position: relative;
-  padding: 0 40px 0 40px;
+  padding: 0 10px 0 40px;
 }
 .header h1,
 .header h2 {
   font-size: 1.6em;
   margin: 10px 0 0;
-}
-.stable .header {
-  padding-right: 10px;
 }
 /* Menu buttons */
 #mw-mf-menu-page,
@@ -349,7 +346,36 @@
   position: absolute;
   top: 0;
 }
-.stable #user-button {
+/* Echo Notifications */
+.is-authenticated .header {
+  padding-right: 40px;
+}
+.is-authenticated #user-button {
+  display: block;
+}
+#user-button {
+  display: none;
+  right: 0;
+  background: url(images/user.png) 50% 50% no-repeat;
+  /* use -webkit prefix for older android browsers eg. nexus 1 */
+
+  -o-background-size: auto 24px;
+  -webkit-background-size: auto 24px;
+  background-size: auto 24px;
+}
+#user-button span {
+  position: absolute;
+  right: 5px;
+  bottom: 7px;
+  font-size: .8em;
+  font-weight: bold;
+  color: #fff;
+  line-height: 1;
+  padding: 1px 4px;
+  background: #c91f2c;
+  border-radius: 3px;
+}
+#user-button span.zero {
   display: none;
 }
 /* hamburger */
diff --git a/stylesheets/common/user.css b/stylesheets/common/user.css
deleted file mode 100644
index c504d1a..0000000
--- a/stylesheets/common/user.css
+++ /dev/null
@@ -1,31 +0,0 @@
-/**
- * DO NOT EDIT THIS FILE
- * This is an automatically generated css file.
- * It was generated by LESS (http://lesscss.org).
- * Please edit the corresponding less file instead.
- * See README.mediawiki for details on installing.
- */
-#user-button {
-  right: 0;
-  background: url(images/user.png) 50% 50% no-repeat;
-  /* use -webkit prefix for older android browsers eg. nexus 1 */
-
-  -o-background-size: auto 24px;
-  -webkit-background-size: auto 24px;
-  background-size: auto 24px;
-}
-#user-button span {
-  position: absolute;
-  right: 5px;
-  bottom: 7px;
-  font-size: .8em;
-  font-weight: bold;
-  color: #fff;
-  line-height: 1;
-  padding: 1px 4px;
-  background: #c91f2c;
-  border-radius: 3px;
-}
-#user-button span.zero {
-  display: none;
-}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Id5ea7a54546fa166fd3ee3d9bb22ca1ab725cffe
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Kaldari <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to