r100245 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100244‎ | r100245 | r100246 >
Date:17:48, 19 October 2011
Author:reedy
Status:ok
Tags:
Comment:
Add a message telling the user the long description of the challenge they are participating in

Add some missing message documentation
Modified paths:
  • /trunk/extensions/Contest/Contest.i18n.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialMyContests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialMyContests.php
@@ -303,9 +303,26 @@
304304 $form->setSubmitText( wfMsg( 'contest-submission-submit' ) );
305305
306306 $challengeId = $contestant->getField( 'challenge_id' );
307 - $challenge = ContestChallenge::getTitlesForIds( $challengeId );
308 - $output->addWikiMsg( 'contest-submission-challenge', $challenge[$challengeId] );
 307+ $challenges = $contest->getChallenges();
309308
 309+ /**
 310+ * @var $challenge ContestChallenge
 311+ */
 312+ $challenge = null;
 313+ foreach( $challenges as $challenge ) {
 314+ if ( $challenge->getId() == $challengeId ) {
 315+ break;
 316+ }
 317+ }
 318+
 319+ if ( $challenge !== null ) {
 320+ $challengeName = $challenge->getField( 'title' );
 321+ $challengeDescription = $challenge->getField( 'text' );
 322+
 323+ $output->addWikiMsg( 'contest-submission-challenge', $challengeName );
 324+ $output->addWikiMsg( 'contest-submission-challenge-description', $challengeName, $challengeDescription );
 325+ }
 326+
310327 if( $form->show() ) {
311328 $query = is_null( $this->submissionState ) ? '' : $this->submissionState;
312329 $output->redirect( $this->getTitle( $contest->getField( 'name' ) )->getLocalURL( $query ) );
Index: trunk/extensions/Contest/Contest.i18n.php
@@ -207,7 +207,8 @@
208208 'contest-submission-invalid-url' => 'This URL does not match one of the allowed formats.',
209209 'contest-submission-new-submission' => 'You still need to enter the URL to your submission. This needs to be done before the deadline.',
210210 'contest-submission-current-submission' => 'This is the URL to your submission, which you can modify untill the deadline.',
211 - 'contest-submission-challenge' => 'You are currently on the $1 challenge',
 211+ 'contest-submission-challenge' => 'You are currently participating in the $1 challenge.',
 212+ 'contest-submission-challenge-description' => "'''Current challenge: $1''' -- $2",
212213
213214 // TODO: how can this be done properly in JS?
214215 'contest-submission-domains' => 'Submissions are restricted to these sites: $1',
@@ -288,6 +289,9 @@
289290 'contest-mycontests-addition-success' => 'Message shown when a user has added a submission',
290291 'contest-mycontests-updated-success' => 'Message shown when a user has editied a submission',
291292 'contest-mycontests-sessionfail' => 'Session failure',
 293+
 294+ 'contest-submission-challenge' => 'Tells the user which challenge they are part of. $1 is the challenge name',
 295+ 'contest-submission-challenge-description' => 'Output of challenge name and description. $1 is the challenge name, $2 is the challenge description',
292296 );
293297
294298 /** German (Deutsch)

Follow-up revisions

RevisionCommit summaryAuthorDate
r1002461.18wmf1 MFT r100240, r100245reedy17:51, 19 October 2011
r100278Follow up to r100245;jeroendedauw21:09, 19 October 2011

Status & tagging log