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

Change subject: Article Deletion handling
......................................................................


Article Deletion handling

Enable redlinks on collection item titles
If page is not known, use canned 'Page is not found' text
in place of excerpt

bug: T90992
Change-Id: Iad880bf5c8f869da28a860414f28b7b641690df5
---
M i18n/en.json
M i18n/qqq.json
M includes/views/CollectionItemCard.php
M resources/ext.gather.styles/collections.less
4 files changed, 17 insertions(+), 5 deletions(-)

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



diff --git a/i18n/en.json b/i18n/en.json
index 6154180..ae4a6d7 100644
--- a/i18n/en.json
+++ b/i18n/en.json
@@ -28,6 +28,7 @@
        "gather-desc": "Component of Mobile Frontend allowing users to curate 
lists.",
        "gather-no-public-lists-title": "No public collections",
        "gather-no-public-lists-description": "There are no public collections 
for this user.",
+       "gather-page-not-found": "Page not found",
        "gather-anon-view-lists": "You need to be logged in to see your 
Collections.",
        "gather-watchlist-title": "Watchlist",
        "gather-watchlist-description": "A list of pages that I am interested 
in.",
diff --git a/i18n/qqq.json b/i18n/qqq.json
index ec47dbb..7e0a29c 100644
--- a/i18n/qqq.json
+++ b/i18n/qqq.json
@@ -31,6 +31,7 @@
        "gather-desc": 
"{{desc|name=Gather|url=https://www.mediawiki.org/wiki/Extension:Gather}}";,
        "gather-no-public-lists-title": "Note: Experimental feature. Messages 
and UI may change radically at any time. Translate at your own risk.\n  The 
title of the view shown when there are no public collections for a user",
        "gather-no-public-lists-description": "Note: Experimental feature. 
Messages and UI may change radically at any time. Translate at your own risk.\n 
 The descriptive text explaining that there are no public collections for a 
user.",
+       "gather-page-not-found": "Note: Experimental feature. Messages and UI 
may change radically at any time. Translate at your own risk.\n  Text in place 
of the collection excerpt explaining that the page does not exist",
        "gather-anon-view-lists": "Note: Experimental feature. Messages and UI 
may change radically at any time. Translate at your own risk.\n Text shown when 
trying to see your own collections on [[Special:Gather]] but the user is not 
logged in.",
        "gather-watchlist-title": "Note: Experimental feature. Messages and UI 
may change radically at any time. Translate at your own risk.\n Title used for 
special casing the Watchlist collection on the [[Special:Gather]] 
page.\n{{Identical|Watchlist}}",
        "gather-watchlist-description": "Note: Experimental feature. Messages 
and UI may change radically at any time. Translate at your own risk.\n Default 
description for special casing the Watchlist collection on the 
[[Special:Gather]] page.",
diff --git a/includes/views/CollectionItemCard.php 
b/includes/views/CollectionItemCard.php
index d3a511c..303f7cd 100644
--- a/includes/views/CollectionItemCard.php
+++ b/includes/views/CollectionItemCard.php
@@ -8,6 +8,7 @@
 use Gather\models;
 use Gather\views\helpers\CSS;
 use \Html;
+use \Linker;
 
 /**
  * View for an item card in a mobile collection.
@@ -51,13 +52,17 @@
                        $this->image->getHtml() .
                        Html::closeElement( 'a' ) .
                        Html::openElement( 'h2', array( 'class' => 
'collection-item-title' ) ) .
-                       Html::element( 'a', array( 'href' => 
$title->getLocalUrl() ),
-                               $this->getTitle()
-                       ) .
+                       Linker::link( $title ) .
                        Html::closeElement( 'h2' );
-               if ( $item->hasExtract() ) {
+               // Handle excerpt for titles with an extract or unknown pages
+               if ( $item->hasExtract() || !$title->isKnown() ) {
+                       if ( $item->hasExtract() ) {
+                               $itemExcerpt = $item->getExtract();
+                       } elseif ( !$title->isKnown() ) {
+                               $itemExcerpt = wfMessage( 
'gather-page-not-found' )->escaped();
+                       }
                        $html .= Html::element(
-                               'p', array( 'class' => 
'collection-item-excerpt' ), $item->getExtract()
+                               'p', array( 'class' => 
'collection-item-excerpt' ), $itemExcerpt
                        );
                }
                $html .= Html::openElement( 'div', array( 'class' => 
'collection-item-footer' ) )
diff --git a/resources/ext.gather.styles/collections.less 
b/resources/ext.gather.styles/collections.less
index e79cd0d..d04389b 100644
--- a/resources/ext.gather.styles/collections.less
+++ b/resources/ext.gather.styles/collections.less
@@ -115,6 +115,11 @@
                        // FIXME: Why is this inconsistent with other headings 
colors
                        color: black;
                        .reset-link-styles();
+                       a {
+                               &.new {
+                                       color: #ba0000;
+                               }
+                       }
                }
 
                .collection-item-footer {

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

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

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

Reply via email to