Index: trunk/extensions/Storyboard/storyboard.sql |
— | — | @@ -7,6 +7,7 @@ |
8 | 8 | story_author_location VARCHAR(255) NOT NULL, |
9 | 9 | story_author_occupation VARCHAR(255) NOT NULL, |
10 | 10 | story_author_image VARCHAR(255) NULL, -- TODO: find out if this is an acceptible way to refer to an image |
| 11 | + story_author_contact VARCHAR(255) NOT NULL -- TODO: confirm with erik this is a mandatory field |
11 | 12 | story_hit_count INT(8) unsigned NOT NULL default '0', |
12 | 13 | story_title VARCHAR(255) NOT NULL, |
13 | 14 | story_text MEDIUMBLOB NOT NULL, |
Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -160,6 +160,7 @@ |
161 | 161 | 'story_author_name' => $wgRequest->getText( 'name' ), |
162 | 162 | 'story_author_location' => $wgRequest->getText( 'location' ), |
163 | 163 | 'story_author_occupation' => $wgRequest->getText( 'occupation' ), |
| 164 | + 'story_author_contact' => $wgRequest->getText( 'storyboard-contact' ), |
164 | 165 | 'story_title' => $wgRequest->getText( 'storytitle' ), |
165 | 166 | 'story_text' => $wgRequest->getText( 'storytext' ), |
166 | 167 | 'story_created' => $dbw->timestamp( time() ), |
Index: trunk/extensions/Storyboard/specials/Story/Story_body.php |
— | — | @@ -60,7 +60,12 @@ |
61 | 61 | 'storyboard', |
62 | 62 | array( |
63 | 63 | 'story_id', |
| 64 | + 'story_author_id', |
64 | 65 | 'story_author_name', |
| 66 | + 'story_author_location', |
| 67 | + 'story_author_occupation', |
| 68 | + 'story_author_contact', |
| 69 | + 'story_author_image', |
65 | 70 | 'story_title', |
66 | 71 | 'story_text', |
67 | 72 | 'story_created', |
— | — | @@ -90,13 +95,27 @@ |
91 | 96 | * Ouputs the story in regular display mode. |
92 | 97 | * |
93 | 98 | * @param $story |
| 99 | + * |
| 100 | + * TODO: Improve layout, add social sharing stuff, add story meta data and show edit stuff for people with stroyreview permission. |
94 | 101 | */ |
95 | 102 | private function showStory( $story ) { |
96 | | - global $wgOut; |
| 103 | + global $wgOut, $egStoryboardScriptPath; |
97 | 104 | |
| 105 | + $wgOut->addStyle( $egStoryboardScriptPath . '/storyboard.css' ); |
98 | 106 | |
| 107 | + $imageSrc = 'http://upload.wikimedia.org/wikipedia/mediawiki/9/99/SemanticMaps.png'; // TODO: get cropped image here |
99 | 108 | |
100 | | - $wgOut->addHTML( '' ); // TODO: add output |
| 109 | + $title = htmlspecialchars( $story->story_title ); |
| 110 | + $text = htmlspecialchars( $story->story_text ); |
| 111 | + |
| 112 | + $wgOut->addHTML( <<<EOT |
| 113 | + <div class="story"> |
| 114 | + <img src="$imageSrc" class="story-image"> |
| 115 | + <div class="story-title">$title</div><br /> |
| 116 | + $text |
| 117 | + </div> |
| 118 | +EOT |
| 119 | + ); |
101 | 120 | } |
102 | 121 | |
103 | 122 | /** |
— | — | @@ -126,33 +145,31 @@ |
127 | 146 | $formBody = "<table width='$width'>"; |
128 | 147 | |
129 | 148 | $defaultName = ''; |
130 | | - if ( $wgUser->isLoggedIn() ) { |
131 | | - $defaultName = $wgUser->getRealName() !== '' ? $wgUser->getRealName() : $wgUser->getName(); |
132 | | - } |
| 149 | + |
133 | 150 | $formBody .= '<tr>' . |
134 | 151 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-yourname' ) ) . |
135 | 152 | '<td>' . |
136 | | - Html::input( 'name', $defaultName, 'text', array( 'size' => $fieldSize ) |
| 153 | + Html::input( 'name', $story->story_author_name, 'text', array( 'size' => $fieldSize ) |
137 | 154 | ) . '</td></tr>'; |
138 | 155 | |
139 | 156 | $formBody .= '<tr>' . |
140 | 157 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-location' ) ) . |
141 | | - '<td>' . Html::input( 'location', '', 'text', array( 'size' => $fieldSize ) |
| 158 | + '<td>' . Html::input( 'location', $story->story_author_location, 'text', array( 'size' => $fieldSize ) |
142 | 159 | ) . '</td></tr>'; |
143 | 160 | |
144 | 161 | $formBody .= '<tr>' . |
145 | 162 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-occupation' ) ) . |
146 | | - '<td>' . Html::input( 'occupation', '', 'text', array( 'size' => $fieldSize ) |
| 163 | + '<td>' . Html::input( 'occupation', $story->story_author_occupation, 'text', array( 'size' => $fieldSize ) |
147 | 164 | ) . '</td></tr>'; |
148 | 165 | |
149 | 166 | $formBody .= '<tr>' . |
150 | 167 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-contact' ) ) . |
151 | | - '<td>' . Html::input( 'contact', '', 'text', array( 'size' => $fieldSize ) |
| 168 | + '<td>' . Html::input( 'contact', $story->story_author_contact, 'text', array( 'size' => $fieldSize ) |
152 | 169 | ) . '</td></tr>'; |
153 | 170 | |
154 | 171 | $formBody .= '<tr>' . |
155 | 172 | Html::element( 'td', array( 'width' => '100%' ), wfMsg( 'storyboard-storytitle' ) ) . |
156 | | - '<td>' . Html::input( 'storytitle', '', 'text', array( 'size' => $fieldSize ) |
| 173 | + '<td>' . Html::input( 'storytitle', $story->story_title, 'text', array( 'size' => $fieldSize ) |
157 | 174 | ) . '</td></tr>'; |
158 | 175 | |
159 | 176 | $formBody .= '<tr><td colspan="2">' . |
— | — | @@ -171,13 +188,9 @@ |
172 | 189 | 'rows' => 7, |
173 | 190 | 'onkeyup' => "stbValidateStory( this, $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )", |
174 | 191 | ), |
175 | | - null |
| 192 | + $story->story_text |
176 | 193 | ) . |
177 | 194 | '</td></tr>'; |
178 | | - |
179 | | - $formBody .= '<tr><td colspan="2"><input type="checkbox" id="storyboard-agreement" /> ' . |
180 | | - htmlspecialchars( wfMsg( 'storyboard-agreement' ) ) . |
181 | | - '</td></tr>'; |
182 | 195 | |
183 | 196 | $formBody .= '<tr><td colspan="2">' . |
184 | 197 | Html::input( '', wfMsg( 'htmlform-submit' ), 'submit', array( 'id' => 'storysubmission-button' ) ) . |
— | — | @@ -194,7 +207,6 @@ |
195 | 208 | 'name' => 'storyform', |
196 | 209 | 'method' => 'post', |
197 | 210 | 'action' => $submissionUrl, |
198 | | - 'onsubmit' => 'return stbValidateSubmission( "storyboard-agreement" );' |
199 | 211 | ), |
200 | 212 | $formBody |
201 | 213 | ); |