jenkins-bot has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/403541 )

Change subject: User page fully managed by MobileFrontend
......................................................................


User page fully managed by MobileFrontend

Previously styles and icons were managed by Minerva.
This meant the icon and styles do not show up on
other skins operating in mobile mode.
e.g. 
http://localhost:8888/w/index.php?title=User:Kaldari&useskin=vector&useformat=mobile

This rectifies this

Change-Id: I9219eb0b18904811db0dec4c50f450c74848a68b
---
M extension.json
M includes/MobileFrontend.body.php
M includes/user_page_cta.mustache
A resources/mobile.userpage.icons/talk.svg
A resources/mobile.userpage.icons/userpage.svg
A resources/mobile.userpage.styles/userpage.less
6 files changed, 85 insertions(+), 1 deletion(-)

Approvals:
  Pmiazga: Looks good to me, approved
  Niedzielski: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/extension.json b/extension.json
index 1b0b831..4ee7e69 100644
--- a/extension.json
+++ b/extension.json
@@ -169,6 +169,23 @@
                                
"resources/mobile.messageBox.styles/messageBox.less"
                        ]
                },
+               "mobile.userpage.icons": {
+                       "class": "ResourceLoaderImageModule",
+                       "selector": ".mw-ui-icon-{name}:before",
+                       "images": {
+                               "talk": 
"resources/mobile.userpage.icons/talk.svg",
+                               "userpage": 
"resources/mobile.userpage.icons/userpage.svg"
+                       }
+               },
+               "mobile.userpage.styles": {
+                       "targets": [
+                               "mobile",
+                               "desktop"
+                       ],
+                       "styles": [
+                               "resources/mobile.userpage.styles/userpage.less"
+                       ]
+               },
                "mobile.messageBox": {
                        "targets": [
                                "mobile",
diff --git a/includes/MobileFrontend.body.php b/includes/MobileFrontend.body.php
index 45f4196..d808201 100644
--- a/includes/MobileFrontend.body.php
+++ b/includes/MobileFrontend.body.php
@@ -83,6 +83,10 @@
                                $pageUser = User::newFromId( $pageUserId );
                                $contentHtml = self::getUserPageContent(
                                        $out, $pageUser );
+                                       $out->addModuleStyles( [
+                                               'mediawiki.ui.icon',
+                                               'mobile.userpage.styles', 
'mobile.userpage.icons'
+                                       ] );
                        }
                }
 
@@ -102,6 +106,9 @@
                // Is the current user viewing their own page?
                $isCurrentUser = $output->getUser()->getName() === 
$pageUsername;
 
+               $data = [
+                       'userIconClass' => MobileUI::iconClass( 'userpage', 
'element', 'mw-ui-icon-large icon' ),
+               ];
                $data['ctaHeading'] = $isCurrentUser ?
                        $context->msg( 
'mobile-frontend-user-page-no-owner-page-yet' )->text() :
                        $context->msg( 'mobile-frontend-user-page-no-page-yet', 
$pageUsername )->parse();
diff --git a/includes/user_page_cta.mustache b/includes/user_page_cta.mustache
index 9c5d39b..a0ce8ef 100644
--- a/includes/user_page_cta.mustache
+++ b/includes/user_page_cta.mustache
@@ -1,5 +1,5 @@
 <div class="cta-holder">
-       <div class="icon mw-ui-icon mw-ui-icon-element mw-ui-icon-userpage 
mw-ui-icon-large"></div>
+       <div class="{{userIconClass}}"></div>
        <h3>{{ctaHeading}}</h3>
        <div class="desc">{{ctaDescription}}</div>
        <div class="jsonly">
diff --git a/resources/mobile.userpage.icons/talk.svg 
b/resources/mobile.userpage.icons/talk.svg
new file mode 100644
index 0000000..d5845b4
--- /dev/null
+++ b/resources/mobile.userpage.icons/talk.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg"; 
width="40" height="30" viewBox="0 0 40 30"><title>talkpage</title><path 
fill="#36c" fill-rule="evenodd" d="M36 9v17.182L40 
30H13V9h23.143H36zm-9-9v8H12v13H0l4-4c-.143.182-.143-17 0-17h23z"/></svg>
\ No newline at end of file
diff --git a/resources/mobile.userpage.icons/userpage.svg 
b/resources/mobile.userpage.icons/userpage.svg
new file mode 100644
index 0000000..161686a
--- /dev/null
+++ b/resources/mobile.userpage.icons/userpage.svg
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><svg xmlns="http://www.w3.org/2000/svg"; 
width="88" height="118" viewBox="0 0 88 118"><title>userpage</title><g 
fill-rule="evenodd"><path d="M86.156 18.4L69.682 
2.166c-.762-.75-1.615-1.612-3.31-1.612H5.608C2.61.554.174 3.03.174 
6.07v106.275c0 3.022 2.436 5.485 5.434 5.485h76.73c3.006 0 5.453-2.463 
5.453-5.485V21.95c-.01-1.715-.83-2.758-1.63-3.55zM83.9 20.43H67.886V4.65L83.9 
20.43zm-1.56 94.38H5.607c-1.32 0-2.398-1.107-2.398-2.465V6.08c0-1.347 
1.093-2.484 2.393-2.484h59.24V21.95a1.51 1.51 0 0 0 1.514 1.512H84.74v88.883c0 
1.358-1.077 2.464-2.405 2.464z"/><path d="M64.76 94.702H20.523a1.51 1.51 0 0 0 
0 3.02h44.24a1.51 1.51 0 0 0 
1.515-1.51c0-.84-.67-1.51-1.516-1.51zm.196-24.457c-12.534-5.314-14.635-7.543-14.99-8.153V60.46c1.4-1.725
 2.497-3.955 3.207-6.498 1.88-1.797 
2.257-4.857.874-7.15v-5.12c0-7.118-4.04-11.204-11.1-11.204-6.947 0-11.102 
4.187-11.102 11.204v5.12c-1.37 2.293-.993 5.343.884 7.14.71 2.543 1.81 4.775 
3.21 6.5v1.64c-.39.69-2.62 2.88-15.017 8.153-1.168.506-1.93 1.703-1.93 
3.042v6.225c0 1.817 1.392 3.286 3.097 3.286h41.7c1.715 0 3.106-1.48 
3.106-3.286v-6.225c.02-1.34-.752-2.536-1.94-3.042zm-1.076 9.277a.375.375 0 0 
1-.09.265l-41.632.01c-.032-.01-.102-.112-.102-.275v-6.225c0-.153.07-.254.09-.264
 13.875-5.9 16.262-8.405 
16.79-10.23.04-.133.06-.275.06-.416v-2.484c0-.366-.13-.732-.386-1.004-1.352-1.527-2.407-3.65-3.047-6.16a1.507
 1.507 0 0 
0-.538-.824c-1.076-.83-1.28-2.585-.416-3.75.19-.263.29-.58.29-.904V41.69c0-3.73 
1.4-8.17 8.063-8.17 5.35 0 8.063 2.745 8.063 8.17v5.576c0 .325.1.64.296.904.954 
1.29.546 3.013-.408 3.75a1.52 1.52 0 0 0-.54.825c-.64 2.505-1.696 4.634-3.048 
6.155-.24.27-.384.637-.384 1.003v2.484c0 .14.02.273.058.405.5 1.755 2.877 4.34 
16.78 10.23.02.01.103.1.103.265v6.235h-.01z"/></g></svg>
\ No newline at end of file
diff --git a/resources/mobile.userpage.styles/userpage.less 
b/resources/mobile.userpage.styles/userpage.less
new file mode 100644
index 0000000..3ca7dfa
--- /dev/null
+++ b/resources/mobile.userpage.styles/userpage.less
@@ -0,0 +1,58 @@
+@import 'mobile.variables';
+@import 'mediawiki.mixins';
+
+.tagline {
+       color: @colorGray5;
+       font-size: 0.8em;
+       margin: 10px 0;
+}
+
+.user-links {
+       margin: 15px 0 0 0;
+       li {
+               display: inline-block;
+               & + li {
+                       margin-left: 4px;
+                       &:before {
+                               content: 'ยท';
+                               right: 2px;
+                               position: relative;
+                       }
+               }
+       }
+       .mw-ui-icon-talk {
+               &:before {
+                       // FIXME: this shouldn't be necessary
+                       margin-right: 0.5em;
+               }
+       }
+}
+
+.cta-holder {
+       background-color: @colorGray14;
+       .box-sizing( border-box );
+       padding: 30px 20px;
+       text-align: center;
+       border-radius: @borderRadius;
+
+       .icon {
+               margin: 0 auto 20px;
+               opacity: 0.2;
+       }
+
+       // be specific in order to override default padding
+       .content & h3 {
+               font-size: 1em;
+               font-family: sans-serif;
+               padding: 0 0 10px;
+       }
+
+       .desc {
+               color: @colorGray7;
+               margin-bottom: 20px;
+       }
+
+       .disabled {
+               visibility: hidden;
+       }
+}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9219eb0b18904811db0dec4c50f450c74848a68b
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: Niedzielski <[email protected]>
Gerrit-Reviewer: Pmiazga <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to