Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/205300
Change subject: Update how deleted pages behave
......................................................................
Update how deleted pages behave
* Footer link removed
* Do not redirect to editor
Bug: T93295
Change-Id: I893bd1efac5b2015d9ef441f810b7eb0c915dd54
---
M includes/views/CollectionItemCard.php
1 file changed, 26 insertions(+), 19 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Gather
refs/changes/00/205300/1
diff --git a/includes/views/CollectionItemCard.php
b/includes/views/CollectionItemCard.php
index 3320d5d..3ea16a6 100644
--- a/includes/views/CollectionItemCard.php
+++ b/includes/views/CollectionItemCard.php
@@ -48,6 +48,9 @@
$item = $this->item;
$title = $item->getTitle();
$img = $this->image->getHtml();
+ $pageUrl = $title->getLocalUrl();
+ $isKnown = $title->isKnown();
+
if ( $img ) {
$img = Html::openElement( 'a', array( 'href' =>
$title->getLocalUrl() ) ) .
$img .
@@ -56,10 +59,11 @@
$html = Html::openElement( 'div', array( 'class' =>
'collection-card' ) ) .
$img .
Html::openElement( 'h2', array( 'class' =>
'collection-card-title' ) ) .
- Linker::link( $title ) .
+ Html::element( 'a', array( 'href' => $pageUrl, 'class'
=> $isKnown ? '' : 'new' ),
+ $title->getPrefixedText() ) .
Html::closeElement( 'h2' );
// Handle excerpt for titles with an extract or unknown pages
- if ( $item->hasExtract() || !$title->isKnown() ) {
+ if ( $item->hasExtract() || !$isKnown ) {
if ( $item->hasExtract() ) {
$itemExcerpt = $item->getExtract();
} elseif ( !$title->isKnown() ) {
@@ -69,24 +73,27 @@
'p', array( 'class' =>
'collection-card-excerpt' ), $itemExcerpt
);
}
- $html .= Html::openElement( 'div', array( 'class' =>
'collection-card-footer' ) )
- . Html::openElement( 'a',
- array(
- 'href' => $title->getLocalUrl(),
- 'class' => CSS::anchorClass(
'progressive' )
+
+ if ( $isKnown ) {
+ $html .= Html::openElement( 'div', array( 'class' =>
'collection-card-footer' ) )
+ . Html::openElement( 'a',
+ array(
+ 'href' => $pageUrl,
+ 'class' => CSS::anchorClass(
'progressive' )
+ )
)
- )
- . wfMessage( 'gather-read-more' )->escaped()
- . Html::element(
- 'span',
- array( 'class' => CSS::iconClass(
- 'collections-read-more', 'element',
'collections-read-more-arrow'
- ) ),
- ''
- )
- . Html::closeElement( 'a' )
- . Html::closeElement( 'div' )
- . Html::closeElement( 'div' );
+ . wfMessage( 'gather-read-more' )->escaped()
+ . Html::element(
+ 'span',
+ array( 'class' => CSS::iconClass(
+ 'collections-read-more',
'element', 'collections-read-more-arrow'
+ ) ),
+ ''
+ )
+ . Html::closeElement( 'a' )
+ . Html::closeElement( 'div' );
+ }
+ $html .= Html::closeElement( 'div' );
return $html;
}
--
To view, visit https://gerrit.wikimedia.org/r/205300
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I893bd1efac5b2015d9ef441f810b7eb0c915dd54
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Gather
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits