Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php |
— | — | @@ -1086,7 +1086,7 @@ |
1087 | 1087 | } |
1088 | 1088 | # Build the review form as needed |
1089 | 1089 | if ( $rev && ( !$this->diffRevs || $this->isReviewableDiff ) ) { |
1090 | | - $form = new RevisionReviewFormUI( $reqUser, $this->article, $rev ); |
| 1090 | + $form = new RevisionReviewFormUI( $this->getContext(), $this->article, $rev ); |
1091 | 1091 | # Default tags and existence of "reject" button depend on context |
1092 | 1092 | if ( $this->diffRevs ) { |
1093 | 1093 | $form->setDiffPriorRev( $this->diffRevs['old'] ); |
Index: trunk/extensions/FlaggedRevs/presentation/RevisionReviewFormUI.php |
— | — | @@ -15,12 +15,13 @@ |
16 | 16 | |
17 | 17 | /** |
18 | 18 | * Generates a brief review form for a page |
19 | | - * @param User $user |
| 19 | + * @param RequestContext $context |
20 | 20 | * @param FlaggedPage $article |
21 | 21 | * @param Revision $rev |
22 | 22 | */ |
23 | | - public function __construct( User $user, FlaggedPage $article, Revision $rev ) { |
24 | | - $this->user = $user; |
| 23 | + public function __construct( IContextSource $context, FlaggedPage $article, Revision $rev ) { |
| 24 | + $this->user = $context->getUser(); |
| 25 | + $this->request = $context->getRequest(); |
25 | 26 | $this->article = $article; |
26 | 27 | $this->rev = $rev; |
27 | 28 | } |
— | — | @@ -142,7 +143,7 @@ |
143 | 144 | } else { |
144 | 145 | list( $u, $ts ) = FRUserActivity::getUserReviewingPage( $this->rev->getPage() ); |
145 | 146 | } |
146 | | - $form .= "<p>"; |
| 147 | + $form .= Xml::openElement( 'p' ); |
147 | 148 | // Page under review (and not by this user)... |
148 | 149 | if ( $u !== null && $u != $this->user->getName() ) { |
149 | 150 | $form .= '<span class="fr-under-review">'; |
— | — | @@ -156,64 +157,69 @@ |
157 | 158 | } elseif ( !$frev ) { // rev not already reviewed |
158 | 159 | $form .= '<span id="mw-fr-reviewing-status" style="display:none;"></span>'; // JS widget |
159 | 160 | } |
160 | | - $form .= "</p>\n"; |
| 161 | + $form .= Xml::closeElement( 'p' ) . "\n"; |
161 | 162 | |
162 | | - if ( $disabled ) { |
163 | | - $form .= Xml::openElement( 'div', array( 'class' => 'fr-rating-controls-disabled', |
164 | | - 'id' => 'fr-rating-controls-disabled' ) ) . "\n"; |
165 | | - } else { |
166 | | - $form .= Xml::openElement( 'div', array( 'class' => 'fr-rating-controls', |
167 | | - 'id' => 'fr-rating-controls' ) ) . "\n"; |
168 | | - } |
| 163 | + # Start rating controls |
| 164 | + $css = $disabled ? 'fr-rating-controls-disabled' : 'fr-rating-controls'; |
| 165 | + $form .= Xml::openElement( 'p', array( 'class' => $css, 'id' => 'fr-rating-controls') ) . "\n"; |
169 | 166 | |
170 | 167 | # Add main checkboxes/selects |
171 | 168 | $form .= Xml::openElement( 'span', |
172 | 169 | array( 'id' => 'mw-fr-ratingselects', 'class' => 'fr-rating-options' ) ) . "\n"; |
173 | | - $form .= self::ratingInputs( $this->user, $flags, (bool)$disabled, (bool)$frev ); |
| 170 | + $form .= self::ratingInputs( $this->user, $flags, (bool)$disabled, (bool)$frev ) . "\n"; |
174 | 171 | $form .= Xml::closeElement( 'span' ) . "\n"; |
175 | 172 | |
176 | | - # Get the file version used for File: pages as needed |
177 | | - $fileKey = $this->getFileVersion(); |
178 | | - # Get template/file version info as needed |
179 | | - list( $templateIDs, $imageSHA1Keys ) = $this->getIncludeVersions(); |
180 | | - # Convert these into flat string params |
181 | | - list( $templateParams, $imageParams, $fileVersion ) = |
182 | | - RevisionReviewForm::getIncludeParams( $templateIDs, $imageSHA1Keys, $fileKey ); |
| 173 | + # Don't put buttons & comment field on the same line as tag inputs. |
| 174 | + if ( !$disabled && !FlaggedRevs::binaryFlagging() ) { // $disabled => no comment/buttons |
| 175 | + $form .= "<br />"; |
| 176 | + } |
183 | 177 | |
184 | | - $form .= Xml::openElement( 'span', |
185 | | - array( 'style' => 'white-space: nowrap;' ) ) . "\n"; |
| 178 | + # Start comment & buttons |
| 179 | + $form .= Xml::openElement( 'span', array( 'id' => 'mw-fr-confirmreview' ) ) . "\n"; |
| 180 | + |
186 | 181 | # Hide comment input if needed |
187 | 182 | if ( !$disabled ) { |
188 | | - if ( count( FlaggedRevs::getTags() ) > 1 ) { |
189 | | - $form .= "<br />"; // Don't put too much on one line |
190 | | - } |
191 | | - $form .= "<span id='mw-fr-commentbox' style='clear:both'>" . |
192 | | - Xml::inputLabel( wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 40, '', |
193 | | - array( 'maxlength' => 255, 'class' => 'fr-comment-box' ) ) . |
194 | | - "   </span>\n"; |
| 183 | + $form .= Xml::inputLabel( |
| 184 | + wfMsg( 'revreview-log' ), 'wpReason', 'wpReason', 40, '', |
| 185 | + array( 'maxlength' => 255, 'id' => 'mw-fr-commentbox', 'class' => 'fr-comment-box' ) |
| 186 | + ); |
| 187 | + $form .= "   " . "\n"; |
195 | 188 | } |
196 | | - # Determine if there will be reject button |
197 | | - $rejectId = $this->rejectRefRevId(); |
198 | 189 | |
199 | | - # Add the submit buttons |
| 190 | + # Add the submit buttons... |
| 191 | + $rejectId = $this->rejectRefRevId(); // determine if there will be reject button |
200 | 192 | $form .= self::submitButtons( $rejectId, $frev, (bool)$disabled, $reviewIncludes ); |
201 | | - # Add "cancel" link |
202 | | - $form .= Linker::link( $article->getTitle(), wfMsg( 'revreview-cancel' ) ); |
| 193 | + if ( $this->request->getVal( 'diff' ) ) { |
| 194 | + $form .= Linker::link( $this->article->getTitle(), wfMsg( 'revreview-cancel' ) ); |
| 195 | + } |
203 | 196 | |
204 | 197 | # Show stability log if there is anything interesting... |
205 | 198 | if ( $article->isPageLocked() ) { |
206 | 199 | $form .= ' ' . FlaggedRevsXML::logToggle( 'revreview-log-toggle-show' ); |
207 | 200 | } |
208 | | - $form .= Xml::closeElement( 'span' ) . "\n";; |
| 201 | + |
| 202 | + # End comment & buttons |
| 203 | + $form .= Xml::closeElement( 'span' ) . "\n"; |
| 204 | + |
209 | 205 | # ..add the actual stability log body here |
210 | | - if ( $article->isPageLocked() ) { |
| 206 | + if ( $article->isPageLocked() ) { |
211 | 207 | $form .= FlaggedRevsXML::stabilityLogExcerpt( $article ); |
212 | 208 | } |
213 | | - $form .= Xml::closeElement( 'div' ) . "\n"; |
214 | 209 | |
| 210 | + # End rating controls |
| 211 | + $form .= Xml::closeElement( 'p' ) . "\n"; |
| 212 | + |
215 | 213 | # Show explanatory text |
216 | 214 | $form .= $this->bottomNotice; |
217 | 215 | |
| 216 | + # Get the file version used for File: pages as needed |
| 217 | + $fileKey = $this->getFileVersion(); |
| 218 | + # Get template/file version info as needed |
| 219 | + list( $templateIDs, $imageSHA1Keys ) = $this->getIncludeVersions(); |
| 220 | + # Convert these into flat string params |
| 221 | + list( $templateParams, $imageParams, $fileVersion ) = |
| 222 | + RevisionReviewForm::getIncludeParams( $templateIDs, $imageSHA1Keys, $fileKey ); |
| 223 | + |
218 | 224 | # Hidden params |
219 | 225 | $form .= Html::hidden( 'title', $reviewTitle->getPrefixedText() ) . "\n"; |
220 | 226 | $form .= Html::hidden( 'target', $article->getTitle()->getPrefixedDBKey() ) . "\n"; |
Index: trunk/extensions/FlaggedRevs/presentation/modules/flaggedrevs.css |
— | — | @@ -317,8 +317,12 @@ |
318 | 318 | color: GrayText; |
319 | 319 | } |
320 | 320 | |
| 321 | +#mw-fr-confirmreview { |
| 322 | + white-space: nowrap; |
| 323 | +} |
321 | 324 | .fr-rating-options { |
322 | 325 | margin-right: 1.5em; |
| 326 | + white-space: nowrap; |
323 | 327 | } |
324 | 328 | |
325 | 329 | .fr-rating-option-0 { |