Index: trunk/extensions/Contest/Contest.i18n.php |
— | — | @@ -108,7 +108,8 @@ |
109 | 109 | |
110 | 110 | // Special:ContestWelcome |
111 | 111 | 'contest-welcome-unknown' => 'There is no contest with the provided name.', |
112 | | - 'contest-welcome-rules' => 'In order to participate, you must agree to [[$1|the contest rules]].', |
| 112 | + 'contest-welcome-rules' => 'In order to participate, you must agree to', // js i18n |
| 113 | + 'contest-welcome-rules-link' => 'the contest rules', // js i18n |
113 | 114 | 'contest-welcome-signup' => 'Signup now', |
114 | 115 | 'contest-welcome-js-off' => 'Contest uses JavaScript for an improved interface. Your browser either does not support JavaScript or has JavaScript turned off.', |
115 | 116 | 'contest-welcome-accept-challenge' => 'Challenge Accepted', |
Index: trunk/extensions/Contest/specials/SpecialContestWelcome.php |
— | — | @@ -46,7 +46,9 @@ |
47 | 47 | $out->returnToMain(); |
48 | 48 | } |
49 | 49 | else if ( $contest->getField( 'status' ) !== Contest::STATUS_ACTIVE ) { |
50 | | - // TODO: show message |
| 50 | + $this->showWarning( 'contest-signup-finished' ); |
| 51 | + $out->addHTML( '<br /><br /><br /><br />' ); |
| 52 | + $out->returnToMain(); |
51 | 53 | } |
52 | 54 | else { |
53 | 55 | $this->showEnabledPage( $contest ); |
— | — | @@ -158,8 +160,13 @@ |
159 | 161 | * @param Contest $contest |
160 | 162 | */ |
161 | 163 | protected function showRules( Contest $contest ) { |
162 | | - // TODO: we might want to have a pop-up with the content here, instead of a link to the page. |
163 | | - $this->getOutput()->addWikiMsgArray( 'contest-welcome-rules', $contest->getField( 'rules_page' ) ); |
| 164 | + $this->getOutput()->addHTML( Html::element( |
| 165 | + 'div', |
| 166 | + array( |
| 167 | + 'id' => 'contest-rules', |
| 168 | + 'data-rules' => ContestUtils::getParsedArticleContent( $contest->getField( 'rules_page' ) ) |
| 169 | + ) |
| 170 | + ) ); |
164 | 171 | } |
165 | 172 | |
166 | 173 | /** |
Index: trunk/extensions/Contest/Contest.php |
— | — | @@ -210,7 +210,9 @@ |
211 | 211 | 'jquery.contestChallenges', 'jquery.fancybox', |
212 | 212 | ), |
213 | 213 | 'messages' => array( |
214 | | - 'contest-welcome-select-header' |
| 214 | + 'contest-welcome-select-header', |
| 215 | + 'contest-welcome-rules', |
| 216 | + 'contest-welcome-rules-link', |
215 | 217 | ) |
216 | 218 | ); |
217 | 219 | |
Index: trunk/extensions/Contest/resources/contest.special.welcome.js |
— | — | @@ -15,6 +15,27 @@ |
16 | 16 | mw.config.get( 'ContestConfig' ) |
17 | 17 | ); |
18 | 18 | |
| 19 | + $rules = $( '#contest-rules' ); |
| 20 | + |
| 21 | + $div = $( '<div />' ).attr( { |
| 22 | + 'style': 'display:none' |
| 23 | + } ).html( $( '<div />' ).attr( { 'id': 'contest-rules-div' } ).html( $rules.attr( 'data-rules' ) ) ); |
| 24 | + |
| 25 | + // TODO: fix very ugly message construction. |
| 26 | + $a = $( '<a />' ).text( mw.msg( 'contest-welcome-rules-link' ) ).attr( { 'href': '#contest-rules-div' } ); |
| 27 | + $p = $( '<p />' ).text( mw.msg( 'contest-welcome-rules' ) + ' ' ).append( $a ).append( '.' ); |
| 28 | + |
| 29 | + $rules.html( $p ).append( $div ); |
| 30 | + |
| 31 | + $a.fancybox( { |
| 32 | + 'width' : '75%', |
| 33 | +// 'height' : '75%', |
| 34 | +// 'autoScale' : true, |
| 35 | + 'transitionIn' : 'none', |
| 36 | + 'transitionOut' : 'none', |
| 37 | + 'type' : 'inline', |
| 38 | +// 'autoDimensions': false |
| 39 | + } ); |
19 | 40 | } ); |
20 | 41 | |
21 | 42 | })( window.jQuery, window.mediaWiki ); |
\ No newline at end of file |