r100246 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100245‎ | r100246 | r100247 >
Date:17:51, 19 October 2011
Author:reedy
Status:old
Tags:
Comment:
1.18wmf1 MFT r100240, r100245
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/Contest (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)
  • /branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/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: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php
@@ -38,11 +38,10 @@
3939
4040 $out = $this->getOutput();
4141
42 - $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) );
43 -
4442 /**
4543 * @var $contest Contest
4644 */
 45+ $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) );
4746
4847 if ( $contest === false ) {
4948 $this->showError( 'contest-welcome-unknown' );
@@ -50,7 +49,7 @@
5150 $out->returnToMain();
5251 }
5352 else if ( ( $contest->getStatus() == Contest::STATUS_FINISHED ) ||
54 - ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) {
 53+ ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) {
5554 $this->showWarning( 'contest-signup-finished' );
5655 $out->addHTML( '<br /><br /><br /><br />' );
5756 $out->returnToMain();
@@ -132,9 +131,14 @@
133132 protected function addContestJS( Contest $contest ) {
134133 $challenges = array();
135134
 135+ $output = $this->getOutput();
 136+ /**
 137+ * @var $challenge ContestChallenge
 138+ */
136139 foreach ( $contest->getChallenges() as /* ContestChallenge */ $challenge ) {
137140 $data = $challenge->toArray();
138141 $data['target'] = $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() );
 142+ $data['text'] = $output->parse( $data['text'] );
139143 $challenges[] = $data;
140144 }
141145
Index: branches/wmf/1.18wmf1/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)
Property changes on: branches/wmf/1.18wmf1/extensions/Contest
___________________________________________________________________
Modified: svn:mergeinfo
295299 Merged /trunk/extensions/Contest:r100240,100245

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r100240Parse Wikitext out of challenge text, doesn't feel like the right place to be...reedy17:09, 19 October 2011
r100245Add a message telling the user the long description of the challenge they are...reedy17:48, 19 October 2011

Status & tagging log