r77051 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r77050‎ | r77051 | r77052 >
Date:05:48, 20 November 2010
Author:aaron
Status:deferred
Tags:
Comment:
* Added reject/review conflict error
* Made "Cancel" a link as with the edit form and actually work for non-JS
* Made revreview-reject-text-list use PLURAL
Modified paths:
  • /trunk/extensions/FlaggedRevs/client/review.js (modified) (history)
  • /trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -101,6 +101,7 @@
102102 'review_denied' => 'Permission denied.',
103103 'review_param_missing' => 'A parameter is missing or invalid.',
104104 'review_cannot_undo' => 'Cannot undo these changes because further pending edits changed the same areas.',
 105+ 'review_cannot_reject' => 'Cannot reject these changes because someone already accepted some (or all) of the edits.',
105106 'review_reject_excessive' => 'Cannot reject this many edits at once.',
106107
107108 'revreview-current' => 'Pending changes',
@@ -252,15 +253,15 @@
253254 'revreview-restriction-none' => 'none',
254255
255256 'revreview-reject-header' => 'Reject changes for $1',
256 - 'revreview-reject-text-list' => 'By completing this action, you will be \'\'\'rejecting\'\'\' the following changes:',
 257+ 'revreview-reject-text-list' => 'By completing this action, you will be \'\'\'rejecting\'\'\' the following {{PLURAL:$1|change|changes}}:',
257258 'revreview-reject-text-revto' => 'This will revert the page back to the [{{fullurl:$1|oldid=$2}} version as of $3].',
258259 'revreview-reject-summary' => 'Edit summary:',
259260 'revreview-reject-confirm' => 'Reject these changes',
260261 'revreview-reject-cancel' => 'Cancel',
261 - 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|one change|$1 changes}} (by $2) and restored revision $3 by $4',
262 - 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|one change|$1 changes}} (by $2) that followed revision $3 by $4',
263 - 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|one change|$1 changes}} and restored revision $2 by $3',
264 - 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|one change|$1 changes}} that followed revision $2 by $3',
 262+ 'revreview-reject-summary-cur' => 'Rejected the last {{PLURAL:$1|change|$1 changes}} (by $2) and restored revision $3 by $4',
 263+ 'revreview-reject-summary-old' => 'Rejected the first {{PLURAL:$1|change|$1 changes}} (by $2) that followed revision $3 by $4',
 264+ 'revreview-reject-summary-cur-short' => 'Rejected the last {{PLURAL:$1|change|$1 changes}} and restored revision $2 by $3',
 265+ 'revreview-reject-summary-old-short' => 'Rejected the first {{PLURAL:$1|change|$1 changes}} that followed revision $2 by $3',
265266 'revreview-reject-usercount' => '{{PLURAL:$1|one user|$1 users}}',
266267
267268 'revreview-reviewlink' => 'pending edits',
Index: trunk/extensions/FlaggedRevs/forms/RevisionReviewForm.php
@@ -318,6 +318,10 @@
319319 } elseif ( !$newRev || $newRev->isDeleted( Revision::DELETED_TEXT ) ) {
320320 return 'review_bad_oldid';
321321 }
 322+ $srev = FlaggedRevision::newFromStable( $this->page, FR_MASTER );
 323+ if ( $srev && $srev->getRevId() > $oldRev->getId() ) {
 324+ return 'review_cannot_reject'; // not really a use case
 325+ }
322326 # Go to confirmation screen first
323327 if ( !$this->rejectConfirm ) {
324328 $status = $this->rejectConfirmationForm( $oldRev, $newRev );
@@ -1033,7 +1037,7 @@
10341038 }
10351039
10361040 // List of revisions being undone...
1037 - $wgOut->addWikiMsg( 'revreview-reject-text-list' );
 1041+ $wgOut->addWikiMsg( 'revreview-reject-text-list', count( $rejectIds ) );
10381042 $wgOut->addHtml( '<ul>' );
10391043 // FIXME: we need a generic revision list class
10401044 $spRevDelete = SpecialPage::getPage( 'RevisionReview' );
@@ -1089,8 +1093,7 @@
10901094 $wgOut->addHtml( '</div>' );
10911095
10921096 $form = Xml::openElement( 'form',
1093 - array( 'method' => 'POST', 'action' => $thisPage->getFullUrl() )
1094 - );
 1097+ array( 'method' => 'POST', 'action' => $thisPage->getFullUrl() ) );
10951098 $form .= Html::hidden( 'action', 'reject' );
10961099 $form .= Html::hidden( 'wpReject', 1 );
10971100 $form .= Html::hidden( 'wpRejectConfirm', 1 );
@@ -1102,8 +1105,10 @@
11031106 $form .= Xml::inputLabel( wfMsg( 'revreview-reject-summary' ), 'wpReason',
11041107 'wpReason', 120, $defaultSummary ) . "<br />";
11051108 $form .= Html::input( 'wpSubmit', wfMsg( 'revreview-reject-confirm' ), 'submit' );
1106 - $form .= Html::input( 'wpCancel', wfMsg( 'revreview-reject-cancel' ),
1107 - 'button', array( 'onClick' => 'history.back();' ) );
 1109+ $form .= ' ';
 1110+ $form .= $this->skin->link( $this->page, wfMsg( 'revreview-reject-cancel' ),
 1111+ array( 'onClick' => 'history.back()' ),
 1112+ array( 'oldid' => $this->refid, 'diff' => $this->oldid ) );
11081113 $form .= Xml::closeElement( 'form' );
11091114
11101115 $wgOut->addHtml( $form );
Index: trunk/extensions/FlaggedRevs/client/review.js
@@ -85,7 +85,7 @@
8686 selectedlevel = levels[0].selectedIndex;
8787 // Update color. Opera does this already, and doing so
8888 // seems to kill custom pretty opera skin form styling.
89 - if( navigator.appName != 'Opera') {
 89+ if( navigator.appName != 'Opera' ) {
9090 value = levels[0].getElementsByTagName('option')[selectedlevel].value;
9191 levels[0].className = 'fr-rating-option-' + value;
9292 }

Status & tagging log