Florianschmidtwelzow has uploaded a new change for review.

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

Change subject: Add default login message to all Loginpages (stable/alpha)
......................................................................

Add default login message to all Loginpages (stable/alpha)

Bug: T87261
Change-Id: I1b09e7ba80d18dc8c19b2aa475c4d269dffc295e
---
M i18n/en.json
M i18n/qqq.json
M includes/MobileFrontend.hooks.php
3 files changed, 10 insertions(+), 0 deletions(-)


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

diff --git a/i18n/en.json b/i18n/en.json
index c8766e1..97564c6 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -168,6 +168,7 @@
        "mobile-frontend-generic-404-title": "Error - Page not found",
        "mobile-frontend-generic-login": "{{SITENAME}} is made by people like 
you.",
        "mobile-frontend-generic-login-action": "Log in to contribute.",
+       "mobile-frontend-generic-login-new": "<strong>{{SITENAME}} is made by 
people like you.</strong><br />Log in to contribute.",
        "mobile-frontend-generic-signup-action": "Sign up to contribute.",
        "mobile-frontend-history": "View edit history of this page.",
        "mobile-frontend-history-404-desc": "Cannot look at history for a page 
that doesn't exist. It may have been deleted or you may have followed a bad 
link.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index 34b23e9..458ca53 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -163,6 +163,7 @@
        "mobile-frontend-generic-404-title": "Title for a generic HTTP 404 
error page.\n{{Identical|Page not found}}",
        "mobile-frontend-generic-login": "Shows on [[Special:UserLogin]] to 
remind them how {{SITENAME}} relies on contributions.",
        "mobile-frontend-generic-login-action": "Call to action that follows 
{{msg-mw|mobile-frontend-generic-login}} asking them to login.",
+       "mobile-frontend-generic-login-new": "Combined message visible on 
[[Special:UserLogin]] to remind users how {{SITENAME}} relies on contributions 
and call to action that follows {{msg-mw|mobile-frontend-generic-login}} asking 
them to login.\n\nSee also:\n* {{msg-mw|mobile-frontend-generic-login}}* 
{{msg-mw|mobile-frontend-generic-login-action}}",
        "mobile-frontend-generic-signup-action": "Call to action that follows 
{{msg-mw|mobile-frontend-generic-login}} asking them to signup.",
        "mobile-frontend-history": "Used as label for the link which points to 
the \"Edit history\" page.\n\nThis is shown on the Main Page in place of a last 
modified label to avoid confusion caused by transclusions.\n\nIf not the Main 
Page, the following message is used:\n* 
{{msg-mw|Mobile-frontend-last-modified-date}}",
        "mobile-frontend-history-404-desc": "Explain the reasons why the user 
may have arrived on {{msg-mw|mobile-frontend-history-404-title}}",
diff --git a/includes/MobileFrontend.hooks.php 
b/includes/MobileFrontend.hooks.php
index 510dbc3..94d32d8 100644
--- a/includes/MobileFrontend.hooks.php
+++ b/includes/MobileFrontend.hooks.php
@@ -490,6 +490,7 @@
                $mobileContext = MobileContext::singleton();
                $isMobileView = $mobileContext->shouldDisplayMobileView();
                $out = $special->getContext()->getOutput();
+               $request = $special->getContext()->getRequest();
                $skin = $out->getSkin()->getSkinName();
 
                $name = $special->getName();
@@ -498,6 +499,12 @@
                // FIXME: Upstream to core (?)
                if ( $name === 'Preferences' && $skin === 'minerva' ) {
                        $out->addModules( 
'skins.minerva.special.preferences.scripts' );
+               }
+
+               // Add default warning message to Special:UserLogin and 
Special:UserCreate
+               // if no warning message set.
+               if ( $name === 'Userlogin' && !$request->getVal( 'warning', 
null ) ) {
+                       $request->setVal( 'warning', 
'mobile-frontend-generic-login-new' );
                }
 
                if ( $isMobileView ) {
@@ -1008,6 +1015,7 @@
                                'mobile-frontend-edit-login-action', // Edit 
button sign in CTA
                                'mobile-frontend-edit-signup-action', // Edit 
button sign-up CTA
                                'mobile-frontend-donate-image-login-action',
+                               'mobile-frontend-generic-login-new', // default 
message
                        )
                );
        }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1b09e7ba80d18dc8c19b2aa475c4d269dffc295e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Florianschmidtwelzow <florian.schmidt.wel...@t-online.de>

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

Reply via email to