Index: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialMyContests.php |
— | — | @@ -303,9 +303,26 @@ |
304 | 304 | $form->setSubmitText( wfMsg( 'contest-submission-submit' ) ); |
305 | 305 | |
306 | 306 | $challengeId = $contestant->getField( 'challenge_id' ); |
307 | | - $challenge = ContestChallenge::getTitlesForIds( $challengeId ); |
308 | | - $output->addWikiMsg( 'contest-submission-challenge', $challenge[$challengeId] ); |
| 307 | + $challenges = $contest->getChallenges(); |
309 | 308 | |
| 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 | + |
310 | 327 | if( $form->show() ) { |
311 | 328 | $query = is_null( $this->submissionState ) ? '' : $this->submissionState; |
312 | 329 | $output->redirect( $this->getTitle( $contest->getField( 'name' ) )->getLocalURL( $query ) ); |
Index: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContestWelcome.php |
— | — | @@ -38,11 +38,10 @@ |
39 | 39 | |
40 | 40 | $out = $this->getOutput(); |
41 | 41 | |
42 | | - $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) ); |
43 | | - |
44 | 42 | /** |
45 | 43 | * @var $contest Contest |
46 | 44 | */ |
| 45 | + $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) ); |
47 | 46 | |
48 | 47 | if ( $contest === false ) { |
49 | 48 | $this->showError( 'contest-welcome-unknown' ); |
— | — | @@ -50,7 +49,7 @@ |
51 | 50 | $out->returnToMain(); |
52 | 51 | } |
53 | 52 | else if ( ( $contest->getStatus() == Contest::STATUS_FINISHED ) || |
54 | | - ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) { |
| 53 | + ( $contest->getStatus() == Contest::STATUS_EXPIRED ) ) { |
55 | 54 | $this->showWarning( 'contest-signup-finished' ); |
56 | 55 | $out->addHTML( '<br /><br /><br /><br />' ); |
57 | 56 | $out->returnToMain(); |
— | — | @@ -132,9 +131,14 @@ |
133 | 132 | protected function addContestJS( Contest $contest ) { |
134 | 133 | $challenges = array(); |
135 | 134 | |
| 135 | + $output = $this->getOutput(); |
| 136 | + /** |
| 137 | + * @var $challenge ContestChallenge |
| 138 | + */ |
136 | 139 | foreach ( $contest->getChallenges() as /* ContestChallenge */ $challenge ) { |
137 | 140 | $data = $challenge->toArray(); |
138 | 141 | $data['target'] = $this->getSignupLink( $contest->getField( 'name' ), $challenge->getId() ); |
| 142 | + $data['text'] = $output->parse( $data['text'] ); |
139 | 143 | $challenges[] = $data; |
140 | 144 | } |
141 | 145 | |
Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php |
— | — | @@ -207,7 +207,8 @@ |
208 | 208 | 'contest-submission-invalid-url' => 'This URL does not match one of the allowed formats.', |
209 | 209 | 'contest-submission-new-submission' => 'You still need to enter the URL to your submission. This needs to be done before the deadline.', |
210 | 210 | '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", |
212 | 213 | |
213 | 214 | // TODO: how can this be done properly in JS? |
214 | 215 | 'contest-submission-domains' => 'Submissions are restricted to these sites: $1', |
— | — | @@ -288,6 +289,9 @@ |
289 | 290 | 'contest-mycontests-addition-success' => 'Message shown when a user has added a submission', |
290 | 291 | 'contest-mycontests-updated-success' => 'Message shown when a user has editied a submission', |
291 | 292 | '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', |
292 | 296 | ); |
293 | 297 | |
294 | 298 | /** German (Deutsch) |
Property changes on: branches/wmf/1.18wmf1/extensions/Contest |
___________________________________________________________________ |
Modified: svn:mergeinfo |
295 | 299 | Merged /trunk/extensions/Contest:r100240,100245 |