Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -141,6 +141,7 @@ |
142 | 142 | 'contest-contestant-yes' => 'Yes', |
143 | 143 | 'contest-contestant-commentcount' => 'Comments', |
144 | 144 | 'contest-contestant-overallrating' => 'Rating', |
| 145 | + 'contest-contestant-rating' => '$1 ($2 {{PLURAL:$2|vote|votes}})' |
145 | 146 | ); |
146 | 147 | |
147 | 148 | /** Message documentation (Message documentation) |
Index: trunk/extensions/Contest/includes/ContestantPager.php |
— | — | @@ -32,8 +32,8 @@ |
33 | 33 | 'contestant_id' => 'contest-contestant-id', |
34 | 34 | 'contestant_volunteer' => 'contest-contestant-volunteer', |
35 | 35 | 'contestant_wmf' => 'contest-contestant-wmf', |
36 | | - 'contestant_comment_count' => 'contest-contestant-commentcount', |
37 | | - 'contestant_overall_rating' => 'contest-contestant-overallrating', |
| 36 | + 'contestant_comments' => 'contest-contestant-commentcount', |
| 37 | + 'contestant_rating' => 'contest-contestant-overallrating', |
38 | 38 | ); |
39 | 39 | |
40 | 40 | $headers = array_map( 'wfMsg', $headers ); |
— | — | @@ -68,6 +68,17 @@ |
69 | 69 | case 'contestant_volunteer': case 'contestant_wmf': |
70 | 70 | $value = wfMsg( 'contest-contestant-' . ( $value === '1' ? 'yes' : 'no' ) ); |
71 | 71 | break; |
| 72 | + case 'contestant_comments': |
| 73 | + $value = $this->getLang()->formatNum( $value ); |
| 74 | + break; |
| 75 | + case 'contestant_rating': |
| 76 | + $value = wfMsgExt( |
| 77 | + 'contest-contestant-rating', |
| 78 | + 'parsemag', |
| 79 | + $this->getLang()->formatNum( $value ), |
| 80 | + $this->getLang()->formatNum( $this->mCurrentRow->contestant_rating_count ) |
| 81 | + ); |
| 82 | + break; |
72 | 83 | } |
73 | 84 | |
74 | 85 | return $value; |
— | — | @@ -80,6 +91,9 @@ |
81 | 92 | 'contestant_id', |
82 | 93 | 'contestant_volunteer', |
83 | 94 | 'contestant_wmf', |
| 95 | + 'contestant_comments', |
| 96 | + 'contestant_rating', |
| 97 | + 'contestant_rating_count', |
84 | 98 | ), |
85 | 99 | 'conds' => $this->conds, |
86 | 100 | ); |
— | — | @@ -105,7 +119,9 @@ |
106 | 120 | array( |
107 | 121 | 'contestant_id', |
108 | 122 | 'contestant_volunteer', |
109 | | - 'contestant_wmf' |
| 123 | + 'contestant_wmf', |
| 124 | + 'contestant_comments', |
| 125 | + 'contestant_rating', |
110 | 126 | ) |
111 | 127 | ); |
112 | 128 | } |
Index: trunk/extensions/Contest/includes/Contest.class.php |
— | — | @@ -387,6 +387,18 @@ |
388 | 388 | } |
389 | 389 | |
390 | 390 | /** |
| 391 | + * Remove the contest and all it's linked data from the database. |
| 392 | + * |
| 393 | + * @since 0.1 |
| 394 | + * |
| 395 | + * @return boolean Success indicator |
| 396 | + */ |
| 397 | + public function removeAllFromDB() { |
| 398 | + // TODO |
| 399 | + return parent::removeFromDB(); |
| 400 | + } |
| 401 | + |
| 402 | + /** |
391 | 403 | * Do all actions that need to be done on contest finish. |
392 | 404 | * |
393 | 405 | * @since 0.1 |
Index: trunk/extensions/Contest/api/ApiDeleteContest.php |
— | — | @@ -30,7 +30,8 @@ |
31 | 31 | $everythingOk = true; |
32 | 32 | |
33 | 33 | foreach ( $params['ids'] as $id ) { |
34 | | - $everythingOk = Contest::s()->delete( array( 'id' => $id ) ) && $everythingOk; |
| 34 | + $contest = new Contest( array( 'id' => $id ) ); |
| 35 | + $everythingOk = $contest->removeAllFromDB() && $everythingOk; |
35 | 36 | } |
36 | 37 | |
37 | 38 | $this->getResult()->addValue( |