JGonera has submitted this change and it was merged.
Change subject: Story 429: Show watchlist photo CTA where photo absent
......................................................................
Story 429: Show watchlist photo CTA where photo absent
Only shows when PageImages is installed and images are not disabled.
Move styles from nearby to watchlist (nearby inherits watchlist styles
currently)
Note: Watchlist funnel is already setup from previous commit (see
I55ca707b41d49859a1f783fb5b7e8fb8179f4946)
Change-Id: I3d523664cf426b5053c13d1d1cf79cfc1b236181
---
M includes/specials/SpecialMobileWatchlist.php
M less/specials/nearby.less
M less/specials/watchlist.less
M stylesheets/specials/nearby.css
M stylesheets/specials/watchlist.css
5 files changed, 31 insertions(+), 27 deletions(-)
Approvals:
JGonera: Verified; Looks good to me, approved
jenkins-bot: Checked
diff --git a/includes/specials/SpecialMobileWatchlist.php
b/includes/specials/SpecialMobileWatchlist.php
index b0a5966..3a86526 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -399,19 +399,23 @@
private function renderThumb( $row ) {
wfProfileIn( __METHOD__ );
- if ( $this->usePageImages && !is_null( $row->pp_value ) ) {
- $file = wfFindFile( $row->pp_value );
- if ( $file ) {
- $thumb = $file->transform( array( 'width' =>
self::THUMB_SIZE, 'height' => self::THUMB_SIZE ) );
- if ( $thumb ) {
- return Html::element( 'div',
- array(
- 'class' => 'listThumb '
. ( $thumb->getWidth() > $thumb->getHeight() ? 'listThumbH' : 'listThumbV' ),
- 'style' =>
'background-image: url("' . wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ) .
'")',
- )
- );
+ if ( $this->usePageImages ) {
+ $props = array(
+ 'class' => 'listThumb needsPhoto',
+ );
+ if ( !is_null( $row->pp_value ) ) {
+ $file = wfFindFile( $row->pp_value );
+ if ( $file ) {
+ $thumb = $file->transform( array(
'width' => self::THUMB_SIZE, 'height' => self::THUMB_SIZE ) );
+ if ( $thumb ) {
+ $props = array(
+ 'class' =>
'listThumb ' . ( $thumb->getWidth() > $thumb->getHeight() ? 'listThumbH' :
'listThumbV' ),
+ 'style' =>
'background-image: url("' . wfExpandUrl( $thumb->getUrl(), PROTO_CURRENT ) .
'")',
+ );
+ }
}
}
+ return Html::element( 'div', $props );
}
wfProfileOut( __METHOD__ );
diff --git a/less/specials/nearby.less b/less/specials/nearby.less
index 5a83fc6..5420d92 100644
--- a/less/specials/nearby.less
+++ b/less/specials/nearby.less
@@ -2,11 +2,6 @@
ul.a-to-z {
li {
- .listThumb.needsPhoto {
- background-image: url(images/camera.png);
- .background-size( 50%, auto );
- }
-
.proximity {
font-size: .8em;
text-transform: none;
diff --git a/less/specials/watchlist.less b/less/specials/watchlist.less
index 4a64d7d..84dbf46 100644
--- a/less/specials/watchlist.less
+++ b/less/specials/watchlist.less
@@ -104,11 +104,16 @@
}
}
-ul.mw-mf-watchlist-results.a-to-z {
+ul.a-to-z {
li {
a.title {
padding-left: (@thumbSpace - @ragWidth);
}
+
+ .listThumb.needsPhoto {
+ background-image: url(images/camera.png);
+ .background-size( 50%, auto );
+ }
}
}
diff --git a/stylesheets/specials/nearby.css b/stylesheets/specials/nearby.css
index 8ff3e0f..7959c6d 100644
--- a/stylesheets/specials/nearby.css
+++ b/stylesheets/specials/nearby.css
@@ -1,12 +1,3 @@
-ul.a-to-z li .listThumb.needsPhoto {
- background-image: url(images/camera.png);
- /* use -webkit prefix for older android browsers eg. nexus 1 */
-
- -moz-background-size: 50% auto;
- -o-background-size: 50% auto;
- -webkit-background-size: 50% auto;
- background-size: 50% auto;
-}
ul.a-to-z li .proximity {
font-size: .8em;
text-transform: none;
diff --git a/stylesheets/specials/watchlist.css
b/stylesheets/specials/watchlist.css
index a6a7898..27b3685 100644
--- a/stylesheets/specials/watchlist.css
+++ b/stylesheets/specials/watchlist.css
@@ -97,9 +97,18 @@
ul.mw-mf-watchlist-results li .mw-mf-user {
margin: .5em 0 0;
}
-ul.mw-mf-watchlist-results.a-to-z li a.title {
+ul.a-to-z li a.title {
padding-left: 77px;
}
+ul.a-to-z li .listThumb.needsPhoto {
+ background-image: url(images/camera.png);
+ /* use -webkit prefix for older android browsers eg. nexus 1 */
+
+ -moz-background-size: 50% auto;
+ -o-background-size: 50% auto;
+ -webkit-background-size: 50% auto;
+ background-size: 50% auto;
+}
.mw-mf-user {
padding: 1px 0 0 20px;
color: #565656 !important;
--
To view, visit https://gerrit.wikimedia.org/r/60696
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I3d523664cf426b5053c13d1d1cf79cfc1b236181
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: jenkins-bot
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits