Jdlrobson has uploaded a new change for review. https://gerrit.wikimedia.org/r/64352
Change subject: Bug 48513: Hide uploads of zero ...................................................................... Bug 48513: Hide uploads of zero Hide them and only show them after that first successful upload Change-Id: If77c936125c7b715ae28261870279c9dddaf9328 --- M includes/specials/SpecialUploads.php M javascripts/specials/uploads.js 2 files changed, 6 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend refs/changes/52/64352/1 diff --git a/includes/specials/SpecialUploads.php b/includes/specials/SpecialUploads.php index 52beede..d419019 100644 --- a/includes/specials/SpecialUploads.php +++ b/includes/specials/SpecialUploads.php @@ -23,6 +23,7 @@ } else { $uploadCount = $this->getUserUploadCount( $user->getName() ); $html = ''; + $attrs = array(); if ( $uploadCount !== false ) { $threshold = $this->getUploadCountThreshold(); $html .= '<div class="ctaUploadPhoto">'; @@ -34,8 +35,11 @@ $msg = $this->msg( 'mobile-frontend-photo-upload-user-count' )->numParams( $uploadCount )->parse(); + if ( $uploadCount === 0 ) { + $attrs = array( 'style' => 'display:none' ); + } } - $html .= Html::openElement( 'h2', array() ) . $msg . Html::closeElement( 'h2' ); + $html .= Html::openElement( 'h2', $attrs ) . $msg . Html::closeElement( 'h2' ); $html .= '</div>'; } $html .= '<ul class="mobileUserGallery"></ul>'; diff --git a/javascripts/specials/uploads.js b/javascripts/specials/uploads.js index 7eda933..0dbfe07 100644 --- a/javascripts/specials/uploads.js +++ b/javascripts/specials/uploads.js @@ -146,7 +146,7 @@ userGallery.addPhoto( image, true ); if ( $counter[ 0 ] ) { newCount = parseInt( $counter.text(), 10 ) + 1; - $counter.parent().html( mw.msg( 'mobile-frontend-photo-upload-user-count', newCount ) ); + $counter.parent().html( mw.msg( 'mobile-frontend-photo-upload-user-count', newCount ) ).show(); } if ( carousel ) { carousel.remove(); -- To view, visit https://gerrit.wikimedia.org/r/64352 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If77c936125c7b715ae28261870279c9dddaf9328 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MobileFrontend Gerrit-Branch: master Gerrit-Owner: Jdlrobson <jrob...@wikimedia.org> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits