[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Show legend of Special:SpecialPages more gradually

2017-07-24 Thread jenkins-bot (Code Review)
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( "$1", 'specialpages-note-top' );
-   $out->wrapWikiMsg( "\n$1\n", '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(
+   "$1", 'specialpages-note-top'
+   );
+   $out->addWikiText(
+   "\n" .
+   implode( "\n", $notes ) .
+   "\n"
+   );
}
}
 }
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* Restricted special pages.",
+   "specialpages-note-restricted": "* Normal special pages.\n* Restricted special pages.",
+   "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 
Gerrit-Reviewer: Florianschmidtwelzow 

[MediaWiki-commits] [Gerrit] mediawiki/core[master]: Show legend of Special:SpecialPages more gradually

2017-07-07 Thread Umherirrender (Code Review)
Umherirrender has uploaded a new change for review. ( 
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 for 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(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/42/363842/1

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( "$1", 'specialpages-note-top' );
-   $out->wrapWikiMsg( "\n$1\n", '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(
+   "$1", 'specialpages-note-top'
+   );
+   $out->addWikiText(
+   "\n" .
+   implode( "\n", $notes ) .
+   "\n"
+   );
}
}
 }
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* Restricted special pages.",
+   "specialpages-note-restricted": "* Normal special pages.\n* Restricted special pages.",
+   "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: newchange
Gerrit-Change-Id: Iec429d450ba7019bbd2cd2301a8280a562341387
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Umherirrender 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org