jenkins-bot has submitted this change and it was merged. Change subject: Add an indexing policy and a link back to the article from Special:MobileCite ......................................................................
Add an indexing policy and a link back to the article from Special:MobileCite * The indexing policy value is "noindex,nofollow" so that we avoid unnecessary concentrations of references-only pages in search engine listings. * The link is especially useful when the user is coming to the page from a shared link or from the search engine. Bug: T136617 Change-Id: Ifaef5114ff0ae8d6955fb7c09bc561535c622822 --- M extension.json M i18n/en.json M i18n/qqq.json A includes/specials/SpecialMobileCite.mustache M includes/specials/SpecialMobileCite.php A resources/mobile.special.mobilecite.styles/mobilecite.less 6 files changed, 23 insertions(+), 1 deletion(-) Approvals: Phuedx: Looks good to me, approved jenkins-bot: Verified diff --git a/extension.json b/extension.json index d5eac0b..a8b034c 100644 --- a/extension.json +++ b/extension.json @@ -1423,6 +1423,12 @@ "class": "MobileUserModule", "position": "bottom" }, + "mobile.special.mobilecite.styles": { + "targets": "mobile", + "styles": [ + "resources/mobile.special.mobilecite.styles/mobilecite.less" + ] + }, "mobile.special.mobilemenu.styles": { "targets": "mobile", "styles": [ diff --git a/i18n/en.json b/i18n/en.json index 1179384..1fec373 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -275,6 +275,7 @@ "mobile-frontend-requires-mobile": "This page is not available on desktop. Please click the mobile view link at the bottom of the page.", "mobile-frontend-requires-optin": "This page is not available unless you opt into our beta mode. Visit the [[Special:MobileOptions|settings page]] to opt in.", "mobile-frontend-requires-title": "Page unavailable", + "mobile-frontend-return-to-page": "Return to page", "mobile-frontend-save-error": "Error saving settings. Please make sure that you have cookies enabled.", "mobile-frontend-save-settings": "Save", "mobile-frontend-saving-exit-page": "Your contribution is still saving. If you leave your contributions will be lost. Are you sure you want to exit?", diff --git a/i18n/qqq.json b/i18n/qqq.json index b4a2d6a..4a9196f 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -273,6 +273,7 @@ "mobile-frontend-requires-mobile": "Message that shows when a special page does not have a desktop equivalent.\n\nPoints user to mobile view link at bottom of page to switch to mobile.\n\nThis should be consistent with {{msg-mw|Mobile-frontend-view}}.", "mobile-frontend-requires-optin": "Message that shows when a page requires beta mode to work. Wikitext that links to [[Special:MobileOptions]] page.", "mobile-frontend-requires-title": "Title shown on page when the page is not available to the user. Currently used for special pages that have no mobile/desktop equivalent or that are only available as experimental features.", + "mobile-frontend-return-to-page": "The text of the link that takes the user back to the article", "mobile-frontend-save-error": "Error message shown when a user tries to save settings form without cookies present.", "mobile-frontend-save-settings": "Text for button for saving settings on [[Special:MobileOptions]]. Since this appears on the settings page translating the word save is sufficient\n{{Identical|Save}}", "mobile-frontend-saving-exit-page": "When a user makes an edit in the page which is happening in the background\nand then tries to leave the page this message is shown to check that they are happy that they will lose their changes.\nThey can either exit the page and lose them or stay on the page until they are complete", diff --git a/includes/specials/SpecialMobileCite.mustache b/includes/specials/SpecialMobileCite.mustache new file mode 100644 index 0000000..63a7476 --- /dev/null +++ b/includes/specials/SpecialMobileCite.mustache @@ -0,0 +1,4 @@ +<div class="mobile-cite-article-link-container"> + <a href="{{article_link}}">{{article_link_title}}</a> +</div> +{{{html}}} diff --git a/includes/specials/SpecialMobileCite.php b/includes/specials/SpecialMobileCite.php index 5fd7bef..a0dfdc8 100644 --- a/includes/specials/SpecialMobileCite.php +++ b/includes/specials/SpecialMobileCite.php @@ -49,6 +49,7 @@ * @param string $pagename The revision number */ public function executeWhenAvailable( $param ) { + $this->setHeaders(); $out = $this->getOutput(); $revision = null; if ( $param ) { @@ -64,7 +65,13 @@ $html = $this->getReferenceBodyHtml( $title, $revId ); $html = MobileUI::contentElement( $html ); $out->setPageTitle( $title->getText() ); - $out->addHTML( $html ); + $args = [ + 'article_link' => $title->getLocalURL(), + 'article_link_title' => $this->msg( 'mobile-frontend-return-to-page' )->text(), + 'html' => $html + ]; + $templateParser = new TemplateParser( __DIR__ ); + $out->addHTML( $templateParser->processTemplate( 'SpecialMobileCite', $args ) ); } else { $out->setPageTitle( $this->msg( 'mobile-frontend-cite-error-title' ) ); $out->addHTML( MobileUI::errorBox( $this->msg( 'mobile-frontend-cite-error' ) ) ); diff --git a/resources/mobile.special.mobilecite.styles/mobilecite.less b/resources/mobile.special.mobilecite.styles/mobilecite.less new file mode 100644 index 0000000..346f220 --- /dev/null +++ b/resources/mobile.special.mobilecite.styles/mobilecite.less @@ -0,0 +1,3 @@ +.mobile-cite-article-link-container { + text-align: center; +} -- To view, visit https://gerrit.wikimedia.org/r/295308 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifaef5114ff0ae8d6955fb7c09bc561535c622822 Gerrit-PatchSet: 7 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: Bmansurov <bmansu...@wikimedia.org> Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com> Gerrit-Reviewer: Jdlrobson <jrob...@wikimedia.org> Gerrit-Reviewer: Phuedx <g...@samsmith.io> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> Gerrit-Reviewer: jenkins-bot <> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits