Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -63,6 +63,10 @@ |
64 | 64 | |
65 | 65 | // Special:ContestWelcome |
66 | 66 | 'contest-welcome-unknown' => 'There is no contest with the provided name.', |
| 67 | + |
| 68 | + // Special:Contest |
| 69 | + 'contest-contest-title' => 'Contest: $1', |
| 70 | + 'contest-contest-no-results' => 'There are no contestants to list.', |
67 | 71 | ); |
68 | 72 | |
69 | 73 | /** Message documentation (Message documentation) |
Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php |
— | — | @@ -45,8 +45,6 @@ |
46 | 46 | |
47 | 47 | $out = $this->getOutput(); |
48 | 48 | |
49 | | - $out->setPageTitle( $this->getDescription() ); |
50 | | - |
51 | 49 | $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) ); |
52 | 50 | |
53 | 51 | if ( $contest === false ) { |
— | — | @@ -55,6 +53,9 @@ |
56 | 54 | $out->returnToMain(); |
57 | 55 | } |
58 | 56 | else { |
| 57 | + // TODO: we might want to have a title field here |
| 58 | + $out->setPageTitle( $contest->getField( 'name' ) ); |
| 59 | + |
59 | 60 | $this->showIntro( $contest ); |
60 | 61 | $this->showChallanges( $contest->getChallanges() ); |
61 | 62 | $this->showOpportunities(); |
Index: trunk/extensions/Contest/specials/SpecialContest.php |
— | — | @@ -34,15 +34,42 @@ |
35 | 35 | return; |
36 | 36 | } |
37 | 37 | |
38 | | - |
| 38 | + $out = $this->getOutput(); |
| 39 | + |
| 40 | + $contest = Contest::s()->selectRow( null, array( 'name' => $subPage ) ); |
| 41 | + |
| 42 | + if ( $contest === false ) { |
| 43 | + $out->redirect( SpecialPage::getTitleFor( 'Contests' )->getLocalURL() ); |
| 44 | + } |
| 45 | + else { |
| 46 | + $out->setPageTitle( wfMsgExt( 'contest-contest-title', 'parseinline', $contest->getField( 'name' ) ) ); |
| 47 | + $this->showGeneralInfo( $contest ); |
| 48 | + $this->showContestants( $contest ); |
| 49 | + } |
39 | 50 | } |
40 | 51 | |
41 | 52 | protected function showGeneralInfo( Contest $contest ) { |
42 | | - |
| 53 | + // TODO |
43 | 54 | } |
44 | 55 | |
45 | | - protected function showParticipants( Contest $contest ) { |
| 56 | + // TODO: list scores and comment counts as well |
| 57 | + protected function showContestants( Contest $contest ) { |
| 58 | + $conds = array( |
| 59 | + 'contestant_contest_id' => $contest->getId() |
| 60 | + ); |
46 | 61 | |
| 62 | + $pager = new ContestantPager( $this, $conds ); |
| 63 | + |
| 64 | + if ( $pager->getNumRows() ) { |
| 65 | + $this->getOutput()->addHTML( |
| 66 | + $pager->getNavigationBar() . |
| 67 | + $pager->getBody(). |
| 68 | + $pager->getNavigationBar() |
| 69 | + ); |
| 70 | + } |
| 71 | + else { |
| 72 | + $this->getOutput()->addWikiMsg( 'contest-contest-no-results' ); |
| 73 | + } |
47 | 74 | } |
48 | 75 | |
49 | 76 | } |
\ No newline at end of file |
Index: trunk/extensions/Contest/includes/ContestantPager.php |
— | — | @@ -1,7 +1,7 @@ |
2 | 2 | <?php |
3 | 3 | |
4 | 4 | /** |
5 | | - * Contestant pager, for on Special:Contestants |
| 5 | + * Contestant pager, for on Special:Contest |
6 | 6 | * |
7 | 7 | * @since 0.1 |
8 | 8 | * |