r99150 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99149‎ | r99150 | r99151 >
Date:21:53, 6 October 2011
Author:jeroendedauw
Status:deferred
Tags:
Comment:
some work on signup flow
Modified paths:
  • /trunk/extensions/Contest/resources/jquery.contestChallanges.js (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestSignup.php (modified) (history)
  • /trunk/extensions/Contest/specials/SpecialContestWelcome.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php
@@ -54,8 +54,35 @@
5555 $out->addHTML( '<br /><br /><br /><br />' );
5656 $out->returnToMain();
5757 }
 58+ else if ( $contest->getField( 'status' ) !== Contest::STATUS_ACTIVE ) {
 59+ // TODO: show message
 60+ }
5861 else {
59 - // TODO: we might want to have a title field here
 62+ $this->showEnabledPage( $contest );
 63+ }
 64+ }
 65+
 66+ protected function showEnabledPage( Contest $contest ) {
 67+ $out = $this->getOutput();
 68+
 69+ $alreadySignedup = $this->getUser()->isLoggedIn();
 70+
 71+ if ( $alreadySignedup ) {
 72+ // Check if the user is already a contestant in this contest.
 73+ // If he is, reirect to submission page, else show signup form.
 74+ $alreadySignedup = ContestContestant::s()->selectRow(
 75+ 'id',
 76+ array(
 77+ 'contest_id' => $contest->getId(),
 78+ 'user_id' => $this->getUser()->getId()
 79+ )
 80+ ) !== false;
 81+ }
 82+
 83+ if ( $alreadySignedup ) {
 84+ $out->redirect( SpecialPage::getTitleFor( 'ContestSubmission', $contest->getField( 'name' ) )->getLocalURL() );
 85+ }
 86+ else {
6087 $out->setPageTitle( $contest->getField( 'name' ) );
6188
6289 $this->showIntro( $contest );
Index: trunk/extensions/Contest/specials/SpecialContestSignup.php
@@ -19,7 +19,7 @@
2020 * @since 0.1
2121 */
2222 public function __construct() {
23 - parent::__construct( 'ContestSignup', 'contestparticipant' );
 23+ parent::__construct( 'ContestSignup' );
2424 }
2525
2626 /**
Index: trunk/extensions/Contest/resources/jquery.contestChallanges.js
@@ -17,8 +17,8 @@
1818 this.challangesList = null;
1919
2020 this.showChallange = function( challange ) {
21 - // TODO
22 - console.log( challange );
 21+ // TODO: show challange pop-up with text and participate button
 22+ window.location = challange.target;
2323 };
2424
2525 this.addChallange = function( challange ) {

Status & tagging log