jenkins-bot has submitted this change and it was merged.

Change subject: Remove privacy tag from public collection
......................................................................


Remove privacy tag from public collection

Use i18n messages, introduce gather-hidden for
lists that are made non-public by an administrator

bug: T95639
Change-Id: I7bc5c53c1c60aac2ebaeb068eec9c0893d16b6d2
---
M i18n/en.json
M i18n/qqq.json
M includes/views/Collection.php
3 files changed, 13 insertions(+), 6 deletions(-)

Approvals:
  Jdlrobson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/i18n/en.json b/i18n/en.json
index 567ead9..b753053 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -74,6 +74,7 @@
        "gather-read-more": "Read more",
        "gather-private": "Private",
        "gather-public": "Public",
+       "gather-hidden": "Hidden",
        "gather-article-count": "$1 {{PLURAL:$1|page|pages}}",
        "gather-empty": "Nothing in this collection yet...",
        "gather-empty-footer": "Create a collection by clicking on the star 
icon while reading a {{SITENAME}} page.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index d7a66ff..b26440c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -78,6 +78,7 @@
        "gather-read-more": "Label for the read more link used on 
[[Special:Gather]].\n{{Identical|Read more}}",
        "gather-private": "Label for a collection when it is not publicly 
visible\n{{Identical|Private}}",
        "gather-public": "Label for a collection when it is publicly 
visible\n{{Identical|Public}}",
+       "gather-hidden": "Label for a collection when it has been hidden from 
the public by an administrator",
        "gather-article-count": "Expression of the number of pages in a 
collection. Parameter:\n* $1 - number of pages in the 
collection\n{{Identical|Page}}",
        "gather-empty": "Message shown on an empty rendered collection on 
[[Special:Gather]].",
        "gather-empty-footer": "Footnote shown on an empty collection on 
[[Special:Gather]] which instructs to the user how to add articles to a 
collection on their wiki. \nParameters: $1 - Name of site",
diff --git a/includes/views/Collection.php b/includes/views/Collection.php
index 3abde95..d22bdac 100644
--- a/includes/views/Collection.php
+++ b/includes/views/Collection.php
@@ -44,16 +44,21 @@
                $collection = $this->collection;
                $description = $collection->getDescription();
                $owner = $collection->getOwner();
+               $privacyMsg = false;
+
                if ( $collection->isHidden() ) {
-                       $privacy = 'Hidden';
-               } else {
-                       $privacy = $collection->isPublic() ? 'Public' : 
'Private';
+                       $privacyMsg = wfMessage( 'gather-hidden' )->plain();
+               } elseif ( !$collection->isPublic() ) {
+                       $privacyMsg = wfMessage( 'gather-private' )->plain();
                }
 
                $html = Html::openElement( 'div', array( 'class' => 
'collection-header' ) ) .
-                       Html::openElement( 'div', array( 'class' => 
'collection-meta' ) ) .
-                               Html::element( 'div', array( 'class' => 
'collection-privacy' ), $privacy ) .
-                       Html::closeElement( 'div' ) .
+                       Html::openElement( 'div', array( 'class' => 
'collection-meta' ) );
+               // Provide privacy tag if collection is not public
+               if ( $privacyMsg ) {
+                       $html .= Html::element( 'div', array( 'class' => 
'collection-privacy' ), $privacyMsg );
+               }
+               $html .= Html::closeElement( 'div' ) .
                        Html::element( 'h1', array( 'id' => 'section_0' ), 
$collection->getTitle() ) .
                        Html::element( 'div', array( 'class' => 
'collection-description' ), $description ) .
                        $this->getOwnerHtml( $owner ) .

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I7bc5c53c1c60aac2ebaeb068eec9c0893d16b6d2
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Robmoen <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to