Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/63169
Change subject: Story 757: Add upload photo CTA to watchlist view as well
......................................................................
Story 757: Add upload photo CTA to watchlist view as well
Change-Id: Ic3ff650103d098b7a905e138e9b14b23ad7536a3
---
M includes/specials/SpecialMobileWatchlist.php
1 file changed, 19 insertions(+), 3 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/69/63169/1
diff --git a/includes/specials/SpecialMobileWatchlist.php
b/includes/specials/SpecialMobileWatchlist.php
index 4cc4bbe..1a346e5 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -303,6 +303,7 @@
$this->showResults( $res, false );
}
+ // FIXME: use templates/articleList.html to keep consistent with nearby
view
function showResults( ResultWrapper $res, $feed ) {
wfProfileIn( __METHOD__ );
@@ -400,6 +401,7 @@
wfProfileIn( __METHOD__ );
if ( $this->usePageImages ) {
+ $needsPhoto = true;
$props = array(
'class' => 'listThumb needsPhoto',
);
@@ -408,6 +410,7 @@
if ( $file ) {
$thumb = $file->transform( array(
'width' => self::THUMB_SIZE, 'height' => self::THUMB_SIZE ) );
if ( $thumb ) {
+ $needsPhoto = false;
$props = array(
'class' =>
'listThumb ' . ( $thumb->getWidth() > $thumb->getHeight() ? 'listThumbH' :
'listThumbV' ),
'style' =>
'background-image: url("' . wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ) .
'")',
@@ -415,11 +418,16 @@
}
}
}
- return Html::element( 'div', $props );
+ return array(
+ 'html' => Html::element( 'div', $props ),
+ 'needsPhoto' => $needsPhoto,
+ );
}
wfProfileOut( __METHOD__ );
- return '';
+ return array(
+ 'html' => '',
+ );
}
private function showFeedResultRow( $row ) {
@@ -486,11 +494,19 @@
$ts = new MWTimestamp( $row->rev_timestamp );
$lastModified = wfMessage(
'mobile-frontend-watchlist-modified', $ts->getHumanTimestamp() )->text();
+ $thumb = $this->renderThumb( $row );
+ if ( isset( $thumb['needsPhoto'] ) && $thumb['needsPhoto'] ) {
+ $cta = Html::element( 'div', array( 'class' => 'info'
), wfMessage( 'mobile-frontend-needs-photo' )->text() );
+ } else {
+ $cta = '';
+ }
+
$output->addHtml(
Html::openElement( 'li', array( 'title' => $titleText )
) .
Html::openElement( 'a', array( 'href' =>
$title->getLocalUrl(), 'class' => 'title' ) ) .
- $this->renderThumb( $row ) .
+ $thumb['html'] .
Html::element( 'h2', array(), $titleText ).
+ $cta .
Html::element( 'div', array( 'class' => 'info' ),
$lastModified ) .
Html::closeElement( 'a' ) .
Html::closeElement( 'li' )
--
To view, visit https://gerrit.wikimedia.org/r/63169
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic3ff650103d098b7a905e138e9b14b23ad7536a3
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits