Jack Phoenix has submitted this change and it was merged. Change subject: Display an informational message on Special:ChallengeStandings when there are no stats yet ......................................................................
Display an informational message on Special:ChallengeStandings when there are no stats yet Change-Id: Ifdd919ca3e58f52cfb8d7b5d61bc1c7419b70343 --- M ChallengeStandings.php M i18n/en.json M i18n/fi.json 3 files changed, 10 insertions(+), 0 deletions(-) Approvals: Jack Phoenix: Verified; Looks good to me, approved diff --git a/ChallengeStandings.php b/ChallengeStandings.php index 1961b8a..25e19ed 100644 --- a/ChallengeStandings.php +++ b/ChallengeStandings.php @@ -79,6 +79,14 @@ $out .= '</table>'; + // No rows = nothing to display. This is the case usually when the + // extension was recently installed, as the users haven't yet had the + // time to challenge each other. Display an informational message in + // that case. + if ( $dbr->numRows( $res ) === 0 ) { + $out = $this->msg( 'challengestandings-empty' )->parse(); + } + $this->getOutput()->addHTML( $out ); } } \ No newline at end of file diff --git a/i18n/en.json b/i18n/en.json index c59a1a1..da47e0c 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -71,6 +71,7 @@ "challengehistory-view-standings": "View standings", "challengestandings": "Challenge Standings", "challengestandings-challengeuser": "challenge user", + "challengestandings-empty": "There are no challenge standings. Why don't you [[Special:ChallengeUser|challenge someone]]?", "challengestandings-l": "L", "challengestandings-t": "T", "challengestandings-title": "{{SITENAME}} Challenge Standings", diff --git a/i18n/fi.json b/i18n/fi.json index 48f3d66..9ef5c1c 100644 --- a/i18n/fi.json +++ b/i18n/fi.json @@ -63,6 +63,7 @@ "challengehistory-view-standings": "Tarkastele tilastoja", "challengestandings": "Haastetilastot", "challengestandings-challengeuser": "haasta käyttäjä", + "challengestandings-empty": "Haastetilastot ovat tyhjät. Miksi et [[Special:ChallengeUser|haastaisi jotakuta]]?", "challengestandings-l": "H", "challengestandings-t": "T", "challengestandings-title": "{{GRAMMAR:genitive|{{SITENAME}}}} haastetilastot", -- To view, visit https://gerrit.wikimedia.org/r/166028 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ifdd919ca3e58f52cfb8d7b5d61bc1c7419b70343 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/Challenge Gerrit-Branch: master Gerrit-Owner: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Jack Phoenix <j...@countervandalism.net> Gerrit-Reviewer: Siebrand <siebr...@kitano.nl> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits