r99566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99565‎ | r99566 | r99567 >
Date:20:50, 11 October 2011
Author:jeroendedauw
Status:ok
Tags:
Comment:
Follow up to r99561; more work on mycontests
Modified paths:
  • /trunk/extensions/Contest/Contest.i18n.php (modified) (history)
  • /trunk/extensions/Contest/api/ApiDeleteContest.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestSignup.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialMyContests.php (modified) (history)
  • /trunk/extensions/Contest/test/ContestValidationTests.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/test/ContestValidationTests.php
@@ -12,7 +12,7 @@
1313 class ContestValidationTests extends MediaWikiTestCase {
1414
1515 /**
16 - * Tests @see SpecialContestSubmission::validateSubmissionField
 16+ * Tests @see SpecialMyContests::::validateSubmissionField
1717 */
1818 public function testURLValidation() {
1919 $tests = array(
@@ -31,10 +31,10 @@
3232
3333 foreach ( $tests as $test => $isValdid ) {
3434 if ( $isValdid ) {
35 - $this->assertEquals( true, SpecialContestSubmission::validateSubmissionField( $test ) );
 35+ $this->assertEquals( true, SpecialMyContests::validateSubmissionField( $test ) );
3636 }
3737 else {
38 - $this->assertFalse( SpecialContestSubmission::validateSubmissionField( $test ) === true );
 38+ $this->assertFalse( SpecialMyContests::validateSubmissionField( $test ) === true );
3939 }
4040 }
4141 }
Index: trunk/extensions/Contest/Contest.i18n.php
@@ -54,7 +54,6 @@
5555 'special-contest' => 'Contest',
5656 'special-contests' => 'Contests',
5757 'special-contestsignup' => 'Contest signup',
58 - 'special-contestsubmission' => 'Contest submission',
5958 'special-contestwelcome' => 'Contest',
6059 'special-editcontest' => 'Edit contest',
6160 'special-mycontests' => 'Contests',
@@ -139,12 +138,6 @@
140139 'contest-submission-submission' => 'Url to your submission',
141140 'contest-submission-invalid-url' => 'This URL does not match one of the allowed formats.',
142141
143 - // Special:ContestSubmission
144 - 'contest-submission-submit' => 'Submit',
145 - 'contest-submission-unknown' => 'There is no contest with the provided name.',
146 - 'contest-submission-header' => 'On this page you can modify your submission until the deadline.',
147 - 'contest-submission-finished' => 'This contest has ended.',
148 -
149142 // Special:Contest
150143 'contest-contest-title' => 'Contest: $1',
151144 'contest-contest-no-results' => 'There are no contestants to list.',
@@ -198,6 +191,11 @@
199192 'contest-mycontests-finished-text' => 'These are the passed contests you have participated in.',
200193 'contest-mycontests-header-contest' => 'Contest',
201194 'contest-mycontests-header-challenge' => 'Challenge',
 195+
 196+ 'contest-submission-submit' => 'Submit',
 197+ 'contest-submission-unknown' => 'There is no contest with the provided name.',
 198+ 'contest-submission-header' => 'On this page you can modify your submission until the deadline.',
 199+ 'contest-submission-finished' => 'This contest has ended.',
202200 );
203201
204202 /** Message documentation (Message documentation)
Index: trunk/extensions/Contest/specials/SpecialMyContests.php
@@ -65,7 +65,7 @@
6666 $contest = $contestants[0]->getContest( array( 'status', 'name' ) );
6767
6868 if ( $contest->getField( 'status' ) == Contest::STATUS_ACTIVE ) {
69 - $this->getOutput()->redirect( SpecialPage::getTitleFor( 'ContestSubmission', $contest->getField( 'name' ) )->getLocalURL() );
 69+ $this->getOutput()->redirect( $this->getTitle( $contest->getField( 'name' ) )->getLocalURL() );
7070 }
7171 else {
7272 $this->displayContestsTable( $contestants );
Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php
@@ -71,7 +71,7 @@
7272 }
7373
7474 if ( $alreadySignedup ) {
75 - $out->redirect( SpecialPage::getTitleFor( 'ContestSubmission', $contest->getField( 'name' ) )->getLocalURL() );
 75+ $out->redirect( SpecialPage::getTitleFor( 'MyContests', $contest->getField( 'name' ) )->getLocalURL() );
7676 }
7777 else {
7878 $out->setPageTitle( $contest->getField( 'name' ) );
Index: trunk/extensions/Contest/specials/SpecialContestSignup.php
@@ -144,7 +144,7 @@
145145 $this->showSignupForm( $contest, $challengeId );
146146 }
147147 else {
148 - $out->redirect( SpecialPage::getTitleFor( 'ContestSubmission', $contest->getField( 'name' ) )->getLocalURL() );
 148+ $out->redirect( SpecialPage::getTitleFor( 'MyContests', $contest->getField( 'name' ) )->getLocalURL() );
149149 }
150150 }
151151
@@ -178,9 +178,7 @@
179179 * @param Contest $contest
180180 */
181181 protected function showSucess( Contest $contest ) {
182 - $out = $this->getOutput();
183 -
184 - // TODO
 182+ $this->getOutput()->redirect( SpecialPage::getTitleFor( 'MyContests', $contest->getField( 'name' ) )->getLocalURL() );
185183 }
186184
187185 /**
Index: trunk/extensions/Contest/api/ApiDeleteContest.php
@@ -68,7 +68,7 @@
6969 public function getParamDescription() {
7070 return array(
7171 'ids' => 'The IDs of the contests to delete',
72 - 'token' => 'Edit token. You can get one of these through prop=info.',
 72+ 'token' => 'Edit token, salted with the contest id',
7373 );
7474 }
7575

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r99561Follow up to r99560; comitted only /specials/jeroendedauw20:37, 11 October 2011

Status & tagging log