Index: trunk/extensions/Storyboard/Storyboard.i18n.php |
— | — | @@ -20,33 +20,37 @@ |
21 | 21 | 'right-storyreview' => 'Review, edit, publish, and hide stories', |
22 | 22 | 'specialpages-group-contribution' => 'Contribution', |
23 | 23 | |
| 24 | + // Story states |
| 25 | + 'storyboard-unpublished' => 'Unpublished', |
| 26 | + 'storyboard-published' => 'Published', |
| 27 | + 'storyboard-hidden' => 'Hidden', |
| 28 | + 'storyboard-unpublish' => 'Unpublish', |
| 29 | + 'storyboard-publish' => 'Publish', |
| 30 | + 'storyboard-hide' => 'Hide', |
| 31 | + |
24 | 32 | // Special:Story |
25 | 33 | 'story' => 'Story', |
26 | | - 'storyboard-submittedbyon' => 'Submitted by $1 on $2.', // FIXME: split $2 in a para for date and time |
| 34 | + 'storyboard-submittedbyon' => 'Submitted by $1 on $2, $3.', |
27 | 35 | 'storyboard-viewstories' => 'View stories', |
28 | 36 | 'storyboard-nosuchstory' => 'The story you requested does not exist. |
29 | 37 | It might have been removed.', |
30 | | - 'storyboard-unpublished' => 'The story you requested has not been published yet.', |
| 38 | + 'storyboard-storyunpublished' => 'The story you requested has not been published yet.', |
31 | 39 | 'storyboard-nostorytitle' => 'You need to specify the title or id of the story you want to view.', |
32 | 40 | 'storyboard-cantedit' => 'You are not allowed to edit stories.', |
33 | 41 | 'storyboard-canedit' => 'You can $1 and publish this story.', |
34 | | - 'storyboard-ispublished' => 'This story has been published and is publicly visible.', |
35 | | - 'storyboard-ishidden' => 'This story has been hidden from the story review interface.', |
36 | | - 'storyboard-createdandmodified' => 'Created on $1 and last modified on $2', // FIXME: split $2 in a para for date and time |
| 42 | + 'storyboard-createdandmodified' => 'Created on $1, $2 and last modified on $3, $4', |
37 | 43 | 'storyboard-authorname' => 'Author name', |
38 | 44 | 'storyboard-authorlocation' => 'Author location', |
39 | 45 | 'storyboard-authoroccupation' => 'Author occupation', |
40 | 46 | 'storyboard-authoremail' => 'Author e-mail address', |
41 | 47 | 'storyboard-thestory' => 'The story', |
| 48 | + 'storyboard-storystate' => 'Story state', |
42 | 49 | |
43 | 50 | // Special:StorySubmission |
44 | 51 | 'storyboard-submissioncomplete' => 'Submission complete', |
45 | 52 | |
46 | 53 | // Story review |
47 | | - 'storyreview' => 'Story review', |
48 | | - 'storyboard-publish' => 'Publish', |
49 | | - 'storyboard-reviewed' => 'Reviewed', |
50 | | - 'storyboard-unreviewed' => 'Unreviewed', |
| 54 | + 'storyreview' => 'Story review', |
51 | 55 | 'storyboard-hideimage' => 'Hide image', |
52 | 56 | 'storyboard-unhideimage' => 'Show image', |
53 | 57 | 'storyboard-deleteimage' => 'Delete image', |
Index: trunk/extensions/Storyboard/tags/Storyboard/Storyboard_body.php |
— | — | @@ -45,6 +45,7 @@ |
46 | 46 | $width = StoryboardUtils::getDimension( $args, 'width', $egStoryboardWidth ); |
47 | 47 | $height = StoryboardUtils::getDimension( $args, 'height', $egStoryboardHeight ); |
48 | 48 | |
| 49 | + // TODO: use this value in the js |
49 | 50 | $languages = Language::getLanguageNames(); |
50 | 51 | if ( array_key_exists( 'language', $args ) && array_key_exists( $args['language'], $languages ) ) { |
51 | 52 | $language = $args['language']; |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -48,7 +48,6 @@ |
49 | 49 | * @return HTML |
50 | 50 | * |
51 | 51 | * TODO: Fix the validation for the story title |
52 | | - * TODO: use HTMLForm |
53 | 52 | */ |
54 | 53 | private static function getFrom( Parser $parser, array $args ) { |
55 | 54 | global $wgUser, $wgStyleVersion, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -116,7 +116,7 @@ |
117 | 117 | $this->showStory( $story ); |
118 | 118 | } |
119 | 119 | elseif ( !$isEdit ) { |
120 | | - $wgOut->addWikiMsg( 'storyboard-unpublished' ); |
| 120 | + $wgOut->addWikiMsg( 'storyboard-storyunpublished' ); |
121 | 121 | |
122 | 122 | if ( $wgUser->isAllowed( 'storyreview' ) ) { |
123 | 123 | global $wgTitle; |
— | — | @@ -169,7 +169,8 @@ |
170 | 170 | 'storyboard-submittedbyon', |
171 | 171 | 'parsemag', |
172 | 172 | $story->story_author_name, |
173 | | - $wgLang->timeanddate( $story->story_created ) |
| 173 | + $wgLang->time( $story->story_created ), |
| 174 | + $wgLang->date( $story->story_created ) |
174 | 175 | ) ) |
175 | 176 | ); |
176 | 177 | |
— | — | @@ -190,10 +191,10 @@ |
191 | 192 | * @param $story |
192 | 193 | * |
193 | 194 | * TODO: Fix the validation for the story title |
194 | | - * TODO: use HTMLForm |
195 | 195 | */ |
196 | 196 | private function showStoryForm( $story ) { |
197 | | - global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
| 197 | + global $wgOut, $wgLang, $wgRequest, $wgUser, $wgJsMimeType; |
| 198 | + global $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
198 | 199 | |
199 | 200 | $wgOut->setPageTitle( $story->story_title ); |
200 | 201 | |
— | — | @@ -214,7 +215,24 @@ |
215 | 216 | |
216 | 217 | $formBody = "<table width='$width'>"; |
217 | 218 | |
| 219 | + // The current value will be selected on page load with jQuery. |
218 | 220 | $formBody .= '<tr>' . |
| 221 | + '<td width="100%"><label for="storystate">' . |
| 222 | + htmlspecialchars( wfMsg( 'storyboard-storystate' ) ) . |
| 223 | + '</label></td><td>' . |
| 224 | + Html::rawElement( |
| 225 | + 'select', |
| 226 | + array( |
| 227 | + 'name' => 'storystate', |
| 228 | + 'id' => 'storystate' |
| 229 | + ), |
| 230 | + '<option value="' . Storyboard_STORY_UNPUBLISHED . '">' . wfMsg( 'storyboard-unpublished' ) . '</option>' . |
| 231 | + '<option value="' . Storyboard_STORY_PUBLISHED . '">' . wfMsg( 'storyboard-published' ) . '</option>' . |
| 232 | + '<option value="' . Storyboard_STORY_HIDDEN . '">' . wfMsg( 'storyboard-hidden' ) . '</option>' |
| 233 | + ) . |
| 234 | + '</td></tr>'; |
| 235 | + |
| 236 | + $formBody .= '<tr>' . |
219 | 237 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-authorname' ) ) . |
220 | 238 | '<td>' . |
221 | 239 | Html::input( |
— | — | @@ -305,15 +323,15 @@ |
306 | 324 | $story->story_text |
307 | 325 | ) . |
308 | 326 | '</td></tr>'; |
309 | | - |
310 | | - // TODO: fix this to work with new state field |
311 | | - $checked = $story->story_state = Storyboard_STORY_PUBLISHED ? 'checked ' : ''; |
312 | | - $formBody .= '<tr><td colspan="2"><input type="checkbox" name="published" ' . $checked . '/> ' . |
313 | | - htmlspecialchars( wfMsg( 'storyboard-ispublished' ) ) . |
314 | | - '</td></tr>'; |
| 327 | + |
| 328 | + $cancelLink = $wgUser->getSkin()->makeKnownLink( |
| 329 | + $this->getTitle( $story->story_title )->getPrefixedText(), |
| 330 | + wfMsgExt( 'cancel', array('parseinline') ) |
| 331 | + ); |
315 | 332 | |
316 | 333 | $formBody .= '<tr><td colspan="2">' . |
317 | 334 | Html::input( '', wfMsg( 'htmlform-submit' ), 'submit', array( 'id' => 'storysubmission-button' ) ) . |
| 335 | + " <span class='editHelp'>$cancelLink</span>" . |
318 | 336 | '</td></tr>'; |
319 | 337 | |
320 | 338 | $formBody .= '</table>'; |
— | — | @@ -325,11 +343,13 @@ |
326 | 344 | htmlspecialchars( wfMsgExt( |
327 | 345 | 'storyboard-createdandmodified', |
328 | 346 | 'parsemag', |
329 | | - $wgLang->timeanddate( $story->story_created ), |
330 | | - $wgLang->timeanddate( $story->story_modified ) |
| 347 | + $wgLang->time( $story->story_created ), |
| 348 | + $wgLang->date( $story->story_created ), |
| 349 | + $wgLang->time( $story->story_modified ), |
| 350 | + $wgLang->date( $story->story_modified ) |
331 | 351 | ) ) . |
332 | 352 | '</legend>' . $formBody . '</fieldset>'; |
333 | | - |
| 353 | + |
334 | 354 | $query = "id=$story->story_id"; |
335 | 355 | |
336 | 356 | $returnTo = $wgRequest->getVal( 'returnto' ); |
— | — | @@ -349,6 +369,10 @@ |
350 | 370 | $wgOut->addHTML( $formBody ); |
351 | 371 | |
352 | 372 | $wgOut->addInlineScript( <<<EOT |
| 373 | +jQuery(document).ready(function() { |
| 374 | + jQuery("#storystate option[value='$story->story_state']").attr('selected', 'selected'); |
| 375 | +}); |
| 376 | + |
353 | 377 | addOnloadHook( |
354 | 378 | function() { |
355 | 379 | stbValidateStory( document.getElementById('storytext'), $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' ) |
— | — | @@ -398,7 +422,7 @@ |
399 | 423 | 'story_title' => $wgRequest->getText( 'storytitle' ), |
400 | 424 | 'story_text' => $wgRequest->getText( 'storytext' ), |
401 | 425 | 'story_modified' => $dbw->timestamp( time() ), |
402 | | - 'story_state' => $wgRequest->getIntOrNull( 'state' ), |
| 426 | + 'story_state' => $wgRequest->getIntOrNull( 'storystate' ), |
403 | 427 | ), |
404 | 428 | array( |
405 | 429 | 'story_id' => $wgRequest->getText( 'storyId' ), |