Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -134,10 +134,12 @@ |
135 | 135 | |
136 | 136 | // Contestant pager |
137 | 137 | 'contest-contestant-id' => 'ID', |
138 | | - 'contest-contestant-volunteer' => 'Interested in volunteering oportunities', |
139 | | - 'contest-contestant-wmf' => 'Interested in job oportunities', |
| 138 | + 'contest-contestant-volunteer' => 'Volunteer', |
| 139 | + 'contest-contestant-wmf' => 'WMF', |
140 | 140 | 'contest-contestant-no' => 'No', |
141 | 141 | 'contest-contestant-yes' => 'Yes', |
| 142 | + 'contest-contestant-commentcount' => 'Comments', |
| 143 | + 'contest-contestant-overallrating' => 'Rating', |
142 | 144 | ); |
143 | 145 | |
144 | 146 | /** Message documentation (Message documentation) |
Index: trunk/extensions/Contest/includes/ContestantPager.php |
— | — | @@ -32,6 +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 | 38 | ); |
37 | 39 | |
38 | 40 | $headers = array_map( 'wfMsg', $headers ); |
— | — | @@ -40,6 +42,27 @@ |
41 | 43 | return $headers; |
42 | 44 | } |
43 | 45 | |
| 46 | + function formatRow( $row ) { |
| 47 | + $this->mCurrentRow = $row; # In case formatValue etc need to know |
| 48 | + $s = Xml::openElement( 'tr', $this->getRowAttrs($row) ); |
| 49 | + |
| 50 | + foreach ( $this->getFieldNames() as $field => $name ) { |
| 51 | + $value = isset( $row->$field ) ? $row->$field : null; |
| 52 | + $formatted = strval( $this->formatValue( $field, $value ) ); |
| 53 | + |
| 54 | + if ( $formatted == '' ) { |
| 55 | + $formatted = ' '; |
| 56 | + } |
| 57 | + $s .= Xml::tags( 'td', $this->getCellAttrs( $field, $value ), $formatted ); |
| 58 | + } |
| 59 | + |
| 60 | + |
| 61 | + |
| 62 | + $s .= "</tr>\n"; |
| 63 | + |
| 64 | + return $s; |
| 65 | + } |
| 66 | + |
44 | 67 | public function formatValue( $name, $value ) { |
45 | 68 | switch ( $name ) { |
46 | 69 | case 'contestant_volunteer': case 'contestant_wmf': |
Index: trunk/extensions/Contest/includes/ContestContestant.php |
— | — | @@ -96,7 +96,11 @@ |
97 | 97 | 'volunteer' => 'bool', |
98 | 98 | 'wmf' => 'bool', |
99 | 99 | |
100 | | - 'submission' => 'wtf', // TODO |
| 100 | + 'submission' => 'str', |
| 101 | + |
| 102 | + 'rating' => 'int', |
| 103 | + 'rating_count' => 'int', |
| 104 | + 'comments' => 'int', |
101 | 105 | ); |
102 | 106 | } |
103 | 107 | |
— | — | @@ -115,7 +119,13 @@ |
116 | 120 | |
117 | 121 | 'country' => '', |
118 | 122 | 'volunteer' => false, |
119 | | - 'wmf' => false |
| 123 | + 'wmf' => false, |
| 124 | + |
| 125 | + 'submission' => '', |
| 126 | + |
| 127 | + 'rating' => 0, |
| 128 | + 'rating_count' => 0, |
| 129 | + 'comments' => 0, |
120 | 130 | ); |
121 | 131 | } |
122 | 132 | |
Index: trunk/extensions/Contest/includes/Contest.class.php |
— | — | @@ -90,10 +90,14 @@ |
91 | 91 | 'id' => 'id', |
92 | 92 | 'name' => 'str', |
93 | 93 | 'status' => 'int', |
94 | | - 'submission_count' => 'int', |
| 94 | + 'end' => 'int', |
| 95 | + |
95 | 96 | 'rules_page' => 'str', |
96 | 97 | 'oppertunities' => 'str', |
97 | 98 | 'intro' => 'str', |
| 99 | + 'help' => 'str', |
| 100 | + |
| 101 | + 'submission_count' => 'int', |
98 | 102 | ); |
99 | 103 | } |
100 | 104 | |
— | — | @@ -108,10 +112,14 @@ |
109 | 113 | return array( |
110 | 114 | 'name' => '', |
111 | 115 | 'status' => self::STATUS_DRAFT, |
112 | | - 'submission_count' => 0, |
| 116 | + 'end' => '', |
| 117 | + |
113 | 118 | 'rules_page' => 'MediaWiki:', |
114 | 119 | 'oppertunities' => 'MediaWiki:', |
115 | 120 | 'intro' => 'MediaWiki:', |
| 121 | + 'help' => '', |
| 122 | + |
| 123 | + 'submission_count' => 0, |
116 | 124 | ); |
117 | 125 | } |
118 | 126 | |
— | — | @@ -346,4 +354,4 @@ |
347 | 355 | return $success; |
348 | 356 | } |
349 | 357 | |
350 | | -} |
\ No newline at end of file |
| 358 | +} |
Index: trunk/extensions/Contest/Contest.sql |
— | — | @@ -7,10 +7,14 @@ |
8 | 8 | contest_id SMALLINT unsigned NOT NULL auto_increment PRIMARY KEY, |
9 | 9 | contest_name VARCHAR(255) NOT NULL, -- String indentifier for the contest |
10 | 10 | contest_status TINYINT unsigned NOT NULL default '0', -- Status of the contest |
11 | | - contest_submission_count SMALLINT unsigned NOT NULL, -- Amount of submissions made to the contest |
| 11 | + contest_end varbinary(14) NOT NULL default '', -- End time of the contest |
| 12 | + |
12 | 13 | contest_rules_page VARCHAR(255) NOT NULL, -- Name of the page with rules |
13 | 14 | contest_oppertunities VARCHAR(255) NOT NULL, -- Name of the page with oppertunities |
14 | | - contest_intro VARCHAR(255) NOT NULL -- Name of the page with the intro text |
| 15 | + contest_intro VARCHAR(255) NOT NULL, -- Name of the page with the intro text |
| 16 | + contest_help VARCHAR(255) NOT NULL, -- Name of the page with contest help |
| 17 | + |
| 18 | + contest_submission_count SMALLINT unsigned NOT NULL-- Amount of submissions made to the contest |
15 | 19 | ) /*$wgDBTableOptions*/; |
16 | 20 | |
17 | 21 | -- Contestants |
— | — | @@ -30,13 +34,18 @@ |
31 | 35 | contestant_volunteer TINYINT unsigned NOT NULL, -- If the user is interested in voluneer oportunities |
32 | 36 | contestant_wmf TINYINT unsigned NOT NULL, -- If the user is interested in a WMF job |
33 | 37 | |
34 | | - contestant_submission TINYBLOB NOT NULL -- URL to the users submission |
| 38 | + contestant_submission TINYBLOB NOT NULL, -- URL to the users submission |
| 39 | + |
| 40 | + contestant_rating TINYINT unsigned NOT NULL, -- The avarage rating of the contestant |
| 41 | + contestant_rating_count SMALLINT unsigned NOT NULL, -- The amount of ratings |
| 42 | + contestant_comments SMALLINT unsigned NOT NULL -- The amount of comments |
35 | 43 | ) /*$wgDBTableOptions*/; |
36 | 44 | |
37 | 45 | -- Challanges |
38 | 46 | CREATE TABLE IF NOT EXISTS /*_*/contest_challanges ( |
39 | 47 | challange_id INT unsigned NOT NULL auto_increment PRIMARY KEY, -- Challange id |
40 | 48 | challange_contest_id INT unsigned NOT NULL, |
| 49 | + |
41 | 50 | challange_text TEXT NOT NULL, |
42 | 51 | challange_title VARCHAR(255) NOT NULL |
43 | 52 | ) /*$wgDBTableOptions*/; |
— | — | @@ -46,6 +55,7 @@ |
47 | 56 | vote_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
48 | 57 | vote_contestant_id INT unsigned NOT NULL, -- Foreign key on contest_contestants.contestant_id |
49 | 58 | vote_user_id INT(10) unsigned NOT NULL, -- Judge user id |
| 59 | + |
50 | 60 | vote_value SMALLINT NOT NULL -- The value of the vote |
51 | 61 | ) /*$wgDBTableOptions*/; |
52 | 62 | |
— | — | @@ -54,6 +64,7 @@ |
55 | 65 | comment_id INT unsigned NOT NULL auto_increment PRIMARY KEY, |
56 | 66 | comment_contestant_id INT unsigned NOT NULL, -- Foreign key on contest_contestants.contestant_id |
57 | 67 | comment_user_id INT(10) unsigned NOT NULL, -- Judge user id |
| 68 | + |
58 | 69 | comment_text TEXT NOT NULL, -- The comment text |
59 | 70 | comment_time varbinary(14) NOT NULL default '' -- The time at which the comment was made |
60 | 71 | ) /*$wgDBTableOptions*/; |
\ No newline at end of file |