Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.i18n.php |
— | — | @@ -161,10 +161,11 @@ |
162 | 162 | 'contest-contest-reminder-cancel' => 'Cancel', |
163 | 163 | 'contest-contest-reminder-sending' => 'Sending...', |
164 | 164 | // We really want // {{PLURAL:$1|contestant|contestants}} here, but the JS i18n shizzle does not support it yet :/ |
165 | | - 'contest-contest-reminder-success' => 'Successfully send the reminder email to $1 contestants', |
| 165 | + 'contest-contest-reminder-success' => 'Successfully sent the reminder email to $1 contestants', |
166 | 166 | 'contest-contest-reminder-close' => 'Close', |
167 | 167 | 'contest-contest-reminder-retry' => 'Retry sending', |
168 | | - 'contest-contest-reminder-failed' => 'Could not send the reminder emails.', |
| 168 | + 'contest-contest-reminder-failed' => 'Could not sent the reminder emails.', |
| 169 | + 'contest-contest-reminder-subject' => 'Subject:', |
169 | 170 | |
170 | 171 | // Contestant pager |
171 | 172 | 'contest-contestant-id' => 'ID', |
— | — | @@ -310,6 +311,7 @@ |
311 | 312 | 'contest-contest-reminder-close' => 'Close button text', |
312 | 313 | 'contest-contest-reminder-retry' => 'Retry button text', |
313 | 314 | 'contest-contest-reminder-failed' => 'Failiure message, displayed in an alert box', |
| 315 | + 'contest-contest-reminder-subject' => 'Email subject indicator', |
314 | 316 | |
315 | 317 | // Special:MyContests |
316 | 318 | 'contest-mycontests-toplink' => 'Text for link in the user menu (i.e. where watchlist and preferences are linked)', |
Index: branches/wmf/1.18wmf1/extensions/Contest/specials/SpecialContest.php |
— | — | @@ -141,7 +141,11 @@ |
142 | 142 | array( |
143 | 143 | 'id' => 'send-reminder', |
144 | 144 | 'data-token' => $this->getUser()->editToken(), |
145 | | - 'data-contest-id' => $contest->getId() |
| 145 | + 'data-contest-id' => $contest->getId(), |
| 146 | + |
| 147 | + // Note: this is a copy of the message in ContestContestant::sendReminderEmail. |
| 148 | + // If it's changed or modified by a hook, this message might not be accurate. |
| 149 | + 'data-reminder-subject' => wfMsgExt( 'contest-email-reminder-title', 'parsemag', $contest->getDaysLeft() ) |
146 | 150 | ), |
147 | 151 | wfMsg( 'contest-contest-send-reminder' ) |
148 | 152 | ) ); |
Index: branches/wmf/1.18wmf1/extensions/Contest/Contest.php |
— | — | @@ -170,6 +170,7 @@ |
171 | 171 | 'contest-contest-reminder-close', |
172 | 172 | 'contest-contest-reminder-retry', |
173 | 173 | 'contest-contest-reminder-failed', |
| 174 | + 'contest-contest-reminder-subject', |
174 | 175 | ), |
175 | 176 | 'dependencies' => array( |
176 | 177 | 'jquery.ui.button', 'jquery.ui.dialog', |
Index: branches/wmf/1.18wmf1/extensions/Contest/RELEASE-NOTES |
— | — | @@ -5,7 +5,7 @@ |
6 | 6 | |
7 | 7 | |
8 | 8 | === Version 0.1 === |
9 | | -2011-10-xx |
| 9 | +2011-10-20 |
10 | 10 | |
11 | 11 | Initial release with these features: |
12 | 12 | |
Index: branches/wmf/1.18wmf1/extensions/Contest/includes/ContestReminderJob.php |
— | — | @@ -33,6 +33,9 @@ |
34 | 34 | * @return bool |
35 | 35 | */ |
36 | 36 | public function run() { |
| 37 | + /** |
| 38 | + * @var $contestant ContestContestant |
| 39 | + */ |
37 | 40 | foreach ( $this->params['contestants'] as /* ContestContestant */ $contestant ) { |
38 | 41 | $contestant->sendReminderEmail( $this->params['emailText'], array( |
39 | 42 | 'daysLeft' => $this->params['daysLeft'], |
Index: branches/wmf/1.18wmf1/extensions/Contest/api/ApiMailContestants.php |
— | — | @@ -70,9 +70,10 @@ |
71 | 71 | $conditions['id'] = $params['ids']; |
72 | 72 | } |
73 | 73 | |
74 | | - $contestants = ContestContestant::s()->select( array( 'contest_id', 'email' ), $conditions ); |
| 74 | + $contestants = ContestContestant::s()->select( array( 'id', 'user_id', 'contest_id', 'email' ), $conditions ); |
75 | 75 | |
76 | | - if ( $contestants !== false && count( $contestants ) > 0 ) { |
| 76 | + $contestantCount = count( $contestants ); |
| 77 | + if ( $contestants !== false && $contestantCount > 0 ) { |
77 | 78 | $setSize = ContestSettings::get( 'reminderJobSize' ); |
78 | 79 | $limit = count( $contestants ); |
79 | 80 | |
— | — | @@ -94,7 +95,7 @@ |
95 | 96 | $this->getResult()->addValue( |
96 | 97 | null, |
97 | 98 | 'contestantcount', |
98 | | - count( $contestants ) |
| 99 | + $contestantCount |
99 | 100 | ); |
100 | 101 | } |
101 | 102 | } |
— | — | @@ -169,7 +170,7 @@ |
170 | 171 | public function getDescription() { |
171 | 172 | return array( |
172 | 173 | 'API module for mailing contestants. Selection criteria will be joined with AND, |
173 | | - except for the challange ids/titles and contest ids/names pairs, which will be joined wit OR.' |
| 174 | + except for the challange ids/titles and contest ids/names pairs, which will be joined with OR.' |
174 | 175 | ); |
175 | 176 | } |
176 | 177 | |
— | — | @@ -184,7 +185,7 @@ |
185 | 186 | 'api.php?action=mailcontestants&ids=42', |
186 | 187 | 'api.php?action=mailcontestants&ids=4|2', |
187 | 188 | 'api.php?action=mailcontestants&contestids=42', |
188 | | - 'api.php?action=mailcontestants&contestnames=Weekend of Code', |
| 189 | + 'api.php?action=mailcontestants&contestnames=Weekend_of_Code', |
189 | 190 | 'api.php?action=mailcontestants&challengetitles=foo|bar|baz', |
190 | 191 | ); |
191 | 192 | } |
Index: branches/wmf/1.18wmf1/extensions/Contest/resources/contest.special.contest.js |
— | — | @@ -1,15 +1,15 @@ |
2 | 2 | /** |
3 | 3 | * JavasSript for the Contest MediaWiki extension. |
4 | 4 | * @see https://www.mediawiki.org/wiki/Extension:Contest |
5 | | - * |
| 5 | + * |
6 | 6 | * @licence GNU GPL v3 or later |
7 | 7 | * @author Jeroen De Dauw <jeroendedauw at gmail dot com> |
8 | 8 | */ |
9 | 9 | |
10 | 10 | (function( $, mw ) { $( document ).ready( function() { |
11 | | - |
| 11 | + |
12 | 12 | var _this = this; |
13 | | - |
| 13 | + |
14 | 14 | this.sendReminder = function( callback ) { |
15 | 15 | var requestArgs = { |
16 | 16 | 'action': 'mailcontestants', |
— | — | @@ -17,7 +17,7 @@ |
18 | 18 | 'token': $( '#send-reminder' ).attr( 'data-token' ), |
19 | 19 | 'contestids': $( '#send-reminder' ).attr( 'data-contest-id' ) |
20 | 20 | }; |
21 | | - |
| 21 | + |
22 | 22 | $.post( |
23 | 23 | wgScriptPath + '/api.php', |
24 | 24 | requestArgs, |
— | — | @@ -26,12 +26,13 @@ |
27 | 27 | } |
28 | 28 | ); |
29 | 29 | }; |
30 | | - |
| 30 | + |
31 | 31 | this.showReminderDialog = function() { |
32 | 32 | var $dialog = null; |
33 | | - |
| 33 | + |
34 | 34 | $dialog = $( '<div />' ).html( '' ).dialog( { |
35 | 35 | 'title': mw.msg( 'contest-contest-reminder-title' ), |
| 36 | + 'minWidth': 550, |
36 | 37 | 'buttons': [ |
37 | 38 | { |
38 | 39 | 'text': mw.msg( 'contest-contest-reminder-send' ), |
— | — | @@ -39,10 +40,10 @@ |
40 | 41 | 'click': function() { |
41 | 42 | var $send = $( '#reminder-send-button' ); |
42 | 43 | var $cancel = $( '#reminder-cancel-button' ); |
43 | | - |
| 44 | + |
44 | 45 | $send.button( 'option', 'disabled', true ); |
45 | 46 | $send.button( 'option', 'label', mw.msg( 'contest-contest-reminder-sending' ) ); |
46 | | - |
| 47 | + |
47 | 48 | _this.sendReminder( function( data ) { |
48 | 49 | if ( data.success ) { |
49 | 50 | $dialog.text( mw.msg( 'contest-contest-reminder-success', data.contestantcount ) ); |
— | — | @@ -52,7 +53,7 @@ |
53 | 54 | else { |
54 | 55 | $send.button( 'option', 'label', mw.msg( 'contest-contest-reminder-retry' ) ); |
55 | 56 | $send.button( 'option', 'disabled', false ); |
56 | | - |
| 57 | + |
57 | 58 | alert( mw.msg( 'contest-contest-reminder-failed' ) ); |
58 | 59 | } |
59 | 60 | } ); |
— | — | @@ -67,12 +68,18 @@ |
68 | 69 | } |
69 | 70 | ] |
70 | 71 | } ); |
71 | | - |
| 72 | + |
72 | 73 | $dialog.append( $( '<p />' ).text( mw.msg( 'contest-contest-reminder-preview' ) ) ).append( '<hr />' ); |
73 | | - |
74 | | - $dialog.append( $( '#reminder-content' ).html() ); |
| 74 | + |
| 75 | + $dialog.append( $( '<p />' ) |
| 76 | + .html( $( '<b />' ) |
| 77 | + .text( mw.msg( 'contest-contest-reminder-subject' ) ) ) |
| 78 | + .append( ' ' + $( '#send-reminder' ).attr( 'data-reminder-subject' ) ) ) |
| 79 | + .append( '<hr />' ); |
| 80 | + |
| 81 | + $dialog.append( $( '#reminder-content' ).html() ); |
75 | 82 | }; |
76 | | - |
| 83 | + |
77 | 84 | $( '#send-reminder' ).button().click( this.showReminderDialog ); |
78 | | - |
79 | | -} ); })( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |
| 85 | + |
| 86 | +} ); })( window.jQuery, window.mediaWiki ); |
Property changes on: branches/wmf/1.18wmf1/extensions/Contest |
___________________________________________________________________ |
Modified: svn:mergeinfo |
80 | 87 | Merged /trunk/extensions/Contest:r100302,100307-100309,100311 |