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

Change subject: Show legend of Special:SpecialPages more gradually
......................................................................


Show legend of Special:SpecialPages more gradually

The legend is shown when restricted or cached pages are shown, but for
cached pages the legend does not contains a text, because there is no
default styling of cached special pages.
Break the note into two messages and disable the message for cached
pages by default. Wikis having style for cached pages can use this
message to create a legend.

Change-Id: Iec429d450ba7019bbd2cd2301a8280a562341387
---
M includes/specials/SpecialSpecialpages.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 27 insertions(+), 5 deletions(-)

Approvals:
  Raimond Spekking: Looks good to me, but someone else must approve
  Florianschmidtwelzow: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/specials/SpecialSpecialpages.php 
b/includes/specials/SpecialSpecialpages.php
index 451669c..4f29082 100644
--- a/includes/specials/SpecialSpecialpages.php
+++ b/includes/specials/SpecialSpecialpages.php
@@ -130,9 +130,29 @@
                        );
                }
 
-               if ( $includesRestrictedPages || $includesCachedPages ) {
-                       $out->wrapWikiMsg( "<h2 
class=\"mw-specialpages-note-top\">$1</h2>", 'specialpages-note-top' );
-                       $out->wrapWikiMsg( "<div 
class=\"mw-specialpages-notes\">\n$1\n</div>", 'specialpages-note' );
+               // add legend
+               $notes = [];
+               if ( $includesRestrictedPages ) {
+                       $restricedMsg = $this->msg( 
'specialpages-note-restricted' );
+                       if ( !$restricedMsg->isDisabled() ) {
+                               $notes[] = $restricedMsg->plain();
+                       }
+               }
+               if ( $includesCachedPages ) {
+                       $cachedMsg = $this->msg( 'specialpages-note-cached' );
+                       if ( !$cachedMsg->isDisabled() ) {
+                               $notes[] = $cachedMsg->plain();
+                       }
+               }
+               if ( $notes !== [] ) {
+                       $out->wrapWikiMsg(
+                               "<h2 
class=\"mw-specialpages-note-top\">$1</h2>", 'specialpages-note-top'
+                       );
+                       $out->addWikiText(
+                               "<div class=\"mw-specialpages-notes\">\n" .
+                               implode( "\n", $notes ) .
+                               "\n</div>"
+                       );
                }
        }
 }
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 7d107d9..a88e21d 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -3773,7 +3773,8 @@
        "specialpages": "Special pages",
        "specialpages-summary": "",
        "specialpages-note-top": "Legend",
-       "specialpages-note": "* Normal special pages.\n* <span 
class=\"mw-specialpagerestricted\">Restricted special pages.</span>",
+       "specialpages-note-restricted": "* Normal special pages.\n* <span 
class=\"mw-specialpagerestricted\">Restricted special pages.</span>",
+       "specialpages-note-cached": "-",
        "specialpages-group-maintenance": "Maintenance reports",
        "specialpages-group-other": "Other special pages",
        "specialpages-group-login": "Login / create account",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 4d854d9..b25b019 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -3963,7 +3963,8 @@
        "specialpages": "{{doc-special|SpecialPages|unlisted=1}}\nDisplay name 
of link to [[Special:SpecialPages]] shown on all pages in the toolbox.\n\nSee 
also:\n* {{msg-mw|Specialpages}}\n* {{msg-mw|Accesskey-t-specialpages}}\n* 
{{msg-mw|Tooltip-t-specialpages}}\n{{Identical|Special page}}",
        "specialpages-summary": "{{doc-specialpagesummary|specialpages}}",
        "specialpages-note-top": "Heading for 
{{msg-mw|specialpages-note}}.\n{{Identical|Legend}}",
-       "specialpages-note": "Footer note for the [[Special:SpecialPages]] 
page",
+       "specialpages-note-restricted": "Footer note for the 
[[Special:SpecialPages]] page",
+       "specialpages-note-cached": "{{ignore}}\nFooter note for the 
[[Special:SpecialPages]] page",
        "specialpages-group-maintenance": 
"{{doc-special-group|like=[[Special:DoubleRedirects]], [[Special:LonelyPages]] 
and [[Special:WantedPages]]}}",
        "specialpages-group-other": 
"{{doc-special-group|like=[[Special:AdminLinks]] and [[Special:BookSources]]}}",
        "specialpages-group-login": 
"{{doc-special-group|like=[[Special:UserLogin]]}}",

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Iec429d450ba7019bbd2cd2301a8280a562341387
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender <umherirrender_de...@web.de>
Gerrit-Reviewer: Florianschmidtwelzow <florian.schmidt.stargatewis...@gmail.com>
Gerrit-Reviewer: Nikerabbit <niklas.laxst...@gmail.com>
Gerrit-Reviewer: Raimond Spekking <raimond.spekk...@gmail.com>
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

Reply via email to