http://www.mediawiki.org/wiki/Special:Code/MediaWiki/100245
Revision: 100245
Author: reedy
Date: 2011-10-19 17:48:54 +0000 (Wed, 19 Oct 2011)
Log Message:
-----------
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
trunk/extensions/Contest/specials/SpecialMyContests.php
Modified: trunk/extensions/Contest/Contest.i18n.php
===================================================================
--- trunk/extensions/Contest/Contest.i18n.php 2011-10-19 17:48:22 UTC (rev
100244)
+++ trunk/extensions/Contest/Contest.i18n.php 2011-10-19 17:48:54 UTC (rev
100245)
@@ -207,7 +207,8 @@
'contest-submission-invalid-url' => 'This URL does not match one of the
allowed formats.',
'contest-submission-new-submission' => 'You still need to enter the URL
to your submission. This needs to be done before the deadline.',
'contest-submission-current-submission' => 'This is the URL to your
submission, which you can modify untill the deadline.',
- 'contest-submission-challenge' => 'You are currently on the $1
challenge',
+ 'contest-submission-challenge' => 'You are currently participating in
the $1 challenge.',
+ 'contest-submission-challenge-description' => "'''Current challenge:
$1''' -- $2",
// TODO: how can this be done properly in JS?
'contest-submission-domains' => 'Submissions are restricted to these
sites: $1',
@@ -288,6 +289,9 @@
'contest-mycontests-addition-success' => 'Message shown when a user has
added a submission',
'contest-mycontests-updated-success' => 'Message shown when a user has
editied a submission',
'contest-mycontests-sessionfail' => 'Session failure',
+
+ 'contest-submission-challenge' => 'Tells the user which challenge they
are part of. $1 is the challenge name',
+ 'contest-submission-challenge-description' => 'Output of challenge name
and description. $1 is the challenge name, $2 is the challenge description',
);
/** German (Deutsch)
Modified: trunk/extensions/Contest/specials/SpecialMyContests.php
===================================================================
--- trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-19
17:48:22 UTC (rev 100244)
+++ trunk/extensions/Contest/specials/SpecialMyContests.php 2011-10-19
17:48:54 UTC (rev 100245)
@@ -303,9 +303,26 @@
$form->setSubmitText( wfMsg( 'contest-submission-submit' ) );
$challengeId = $contestant->getField( 'challenge_id' );
- $challenge = ContestChallenge::getTitlesForIds( $challengeId );
- $output->addWikiMsg( 'contest-submission-challenge',
$challenge[$challengeId] );
+ $challenges = $contest->getChallenges();
+ /**
+ * @var $challenge ContestChallenge
+ */
+ $challenge = null;
+ foreach( $challenges as $challenge ) {
+ if ( $challenge->getId() == $challengeId ) {
+ break;
+ }
+ }
+
+ if ( $challenge !== null ) {
+ $challengeName = $challenge->getField( 'title' );
+ $challengeDescription = $challenge->getField( 'text' );
+
+ $output->addWikiMsg( 'contest-submission-challenge',
$challengeName );
+ $output->addWikiMsg(
'contest-submission-challenge-description', $challengeName,
$challengeDescription );
+ }
+
if( $form->show() ) {
$query = is_null( $this->submissionState ) ? '' :
$this->submissionState;
$output->redirect( $this->getTitle( $contest->getField(
'name' ) )->getLocalURL( $query ) );
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs