Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php |
— | — | @@ -81,9 +81,9 @@ |
82 | 82 | 'revreview-accuracy-4' => 'Featured', |
83 | 83 | 'revreview-auto' => '(automatic)', |
84 | 84 | 'revreview-basic' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>. |
85 | | -There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
| 85 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] {{PLURAL:$3|awaits|await}} review.', |
86 | 86 | 'revreview-basic-i' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>. |
87 | | -There are [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
| 87 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] await review.', |
88 | 88 | 'revreview-basic-old' => 'This is a [[{{MediaWiki:Validationpage}}|checked]] version ([{{fullurl:{{#Special:ReviewedVersions}}|page={{FULLPAGENAMEE}}}} list all]), [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
89 | 89 | New [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} changes] may have been made.', |
90 | 90 | 'revreview-basic-same' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>.', |
— | — | @@ -117,7 +117,6 @@ |
118 | 118 | 'revreview-draft-title' => 'Pending changes are displayed on this page', |
119 | 119 | 'revreview-edit' => 'Edit', |
120 | 120 | 'revreview-editnotice' => '\'\'\'Your changes will be displayed to readers once an authorized user reviews them. ([[{{MediaWiki:Validationpage}}|help]])\'\'\'', |
121 | | - 'revreview-pendingnotice' => "'''This is a [[{{MediaWiki:Validationpage}}|pending revision]] of this page. It may differ from the [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} latest accepted revision], which was accepted on <i>$1</i>.'''", |
122 | 121 | 'revreview-check-flag-p' => 'Accept this version (includes $1 pending {{PLURAL:$1|change|changes}})', |
123 | 122 | 'revreview-check-flag-p-title' => 'Accept the result of the pending changes and the changes you made here. Use this only if you have already seen the entire pending changes diff.', |
124 | 123 | 'revreview-check-flag-u' => 'Accept this unreviewed page', |
— | — | @@ -138,10 +137,14 @@ |
139 | 138 | 'revreview-main' => 'You must select a particular revision of a content page in order to review. |
140 | 139 | |
141 | 140 | See the [[Special:Unreviewedpages|list of unreviewed pages]].', |
142 | | - 'revreview-newest-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>. There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
143 | | - 'revreview-newest-basic-i' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>. There are [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
144 | | - 'revreview-newest-quality' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
145 | | - 'revreview-newest-quality-i' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. There are [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
| 141 | + 'revreview-newest-basic' => '[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 {{PLURAL:$3|change|changes}}] in this version {{PLURAL:$3|is|are}} [[{{MediaWiki:Validationpage}}|pending review]]. |
| 142 | + The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>.', |
| 143 | + 'revreview-newest-basic-i' => '[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] in this version are [[{{MediaWiki:Validationpage}}|pending review]]. |
| 144 | + The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>.', |
| 145 | + 'revreview-newest-quality' => '[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 {{PLURAL:$3|change|changes}}] in this version {{PLURAL:$3|is|are}} [[{{MediaWiki:Validationpage}}|pending review]]. |
| 146 | + The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>.', |
| 147 | + 'revreview-newest-quality-i' => '[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] in this version are [[{{MediaWiki:Validationpage}}|pending review]]. |
| 148 | + The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>.', |
146 | 149 | 'revreview-pending-basic' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} checked] on <i>$2</i>. There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
147 | 150 | 'revreview-pending-quality' => 'The [{{fullurl:{{FULLPAGENAMEE}}|stable=1}} stable version] was [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
148 | 151 | 'revreview-pending-nosection' => 'Try viewing the [{{fullurl:{{FULLPAGENAMEE}}|stable=0}} latest revision], which includes |
— | — | @@ -151,9 +154,9 @@ |
152 | 155 | 'revreview-notes' => 'Observations or notes to display:', |
153 | 156 | 'revreview-oldrating' => 'It was rated:', |
154 | 157 | 'revreview-quality' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
155 | | -There {{PLURAL:$3|is|are}} [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] awaiting review.', |
| 158 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} $3 pending {{PLURAL:$3|change|changes}}] {{PLURAL:$3|awaits|awaits}} review.', |
156 | 159 | 'revreview-quality-i' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
157 | | -There are [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} template/file changes] awaiting review.', |
| 160 | +[{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} Template/file changes] await review.', |
158 | 161 | 'revreview-quality-old' => 'This is a [[{{MediaWiki:Validationpage}}|quality]] version ([{{fullurl:{{#Special:ReviewedVersions}}|page={{FULLPAGENAMEE}}}} list all]), [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>. |
159 | 162 | New [{{fullurl:{{FULLPAGENAMEE}}|oldid=$1&diff=cur&diffonly=0}} changes] may have been made.', |
160 | 163 | 'revreview-quality-same' => 'This is the [[{{MediaWiki:Validationpage}}|stable version]], [{{fullurl:{{#Special:Log}}|type=review&page={{FULLPAGENAMEE}}}} approved] on <i>$2</i>.', |
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -433,23 +433,29 @@ |
434 | 434 | protected function showDraftVersion( FlaggedRevision $srev, &$tag, $prot ) { |
435 | 435 | global $wgUser, $wgOut, $wgLang, $wgRequest; |
436 | 436 | $this->load(); |
| 437 | + if ( $wgOut->isPrintable() ) { |
| 438 | + return; // all this function does is add notices; don't show them |
| 439 | + } |
437 | 440 | $flags = $srev->getTags(); |
438 | 441 | $time = $wgLang->date( $srev->getTimestamp(), true ); |
439 | 442 | # Get quality level |
440 | 443 | $quality = FlaggedRevs::isQuality( $flags ); |
441 | 444 | # Get stable version sync status |
442 | 445 | $synced = $this->article->stableVersionIsSynced(); |
443 | | - if ( $synced ) { |
444 | | - $this->setReviewNotes( $srev ); // Still the same |
445 | | - } else { |
446 | | - # Make sure there is always a notice bar when viewing the draft |
447 | | - if ( $this->useSimpleUI() ) { // already one for detailed UI |
448 | | - $this->setPendingNotice( $srev ); |
| 446 | + if ( $synced ) { // draft == stable |
| 447 | + $diffToggle = ''; // no diff to show |
| 448 | + $this->setReviewNotes( $srev ); // same review notes apply |
| 449 | + } else { // draft != stable |
| 450 | + # The user may want the diff (via prefs) |
| 451 | + $diffToggle = $this->getTopDiffToggle( $srev, $quality ); |
| 452 | + if ( $diffToggle != '' ) $diffToggle = " $diffToggle"; |
| 453 | + # Make sure there is always a notice bar when viewing the draft. |
| 454 | + if ( $this->useSimpleUI() ) { // we already one for detailed UI |
| 455 | + $this->setPendingNotice( $srev, $diffToggle ); |
449 | 456 | } |
450 | | - $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs) |
451 | 457 | } |
452 | | - # If they are synced, do special styling |
453 | | - # Give notice to newer users if an unreviewed edit was completed... |
| 458 | + # Give a "your edit is pending" notice to newer users if |
| 459 | + # an unreviewed edit was completed... |
454 | 460 | if ( $wgRequest->getVal( 'shownotice' ) |
455 | 461 | && $this->article->getUserText() == $wgUser->getName() // FIXME: rawUserText? |
456 | 462 | && $this->article->revsArePending() |
— | — | @@ -470,10 +476,10 @@ |
471 | 477 | # Notice should always use subtitle |
472 | 478 | $this->reviewNotice = "<div id='mw-fr-reviewnotice' " . |
473 | 479 | "class='flaggedrevs_preview plainlinks'>$pending</div>"; |
474 | | - # Construct some tagging for non-printable outputs. Note that the pending |
475 | | - # notice has all this info already, so don't do this if we added that already. |
| 480 | + # Otherwise, construct some tagging info for non-printable outputs. |
476 | 481 | # Also, if low profile UI is enabled and the page is synced, skip the tag. |
477 | | - } else if ( !$wgOut->isPrintable() && !( $this->article->lowProfileUI() && $synced ) ) { |
| 482 | + # Note: the "your edit is pending" notice has all this info, so we never add both. |
| 483 | + } else if ( !( $this->article->lowProfileUI() && $synced ) ) { |
478 | 484 | $revsSince = $this->article->getPendingRevCount(); |
479 | 485 | // Simple icon-based UI |
480 | 486 | if ( $this->useSimpleUI() ) { |
— | — | @@ -523,7 +529,7 @@ |
524 | 530 | $icon = $synced |
525 | 531 | ? FlaggedRevsXML::stableStatusIcon( $quality ) |
526 | 532 | : FlaggedRevsXML::draftStatusIcon(); |
527 | | - $tag .= $prot . $icon . $msgHTML; |
| 533 | + $tag .= $prot . $icon . $msgHTML . $diffToggle; |
528 | 534 | } |
529 | 535 | } |
530 | 536 | } |
— | — | @@ -728,12 +734,12 @@ |
729 | 735 | } |
730 | 736 | |
731 | 737 | /** |
732 | | - * Add diff-to-stable to top of page views as needed |
| 738 | + * Get collapsible diff-to-stable html to add to the review notice as needed |
733 | 739 | * @param FlaggedRevision $srev, stable version |
734 | 740 | * @param bool $quality, revision is quality |
735 | | - * @returns bool, diff added to output |
| 741 | + * @returns string, the html line (either "" or "<diff toggle><diff div>") |
736 | 742 | */ |
737 | | - protected function maybeShowTopDiff( FlaggedRevision $srev, $quality ) { |
| 743 | + protected function getTopDiffToggle( FlaggedRevision $srev, $quality ) { |
738 | 744 | global $wgUser; |
739 | 745 | $this->load(); |
740 | 746 | if ( !$wgUser->getBoolOption( 'flaggedrevsviewdiffs' ) ) { |
— | — | @@ -771,25 +777,15 @@ |
772 | 778 | } else { |
773 | 779 | $multiNotice = ''; |
774 | 780 | } |
775 | | - $items = array(); |
776 | | - $diffHtml = |
777 | | - FlaggedRevsXML::pendingEditNotice( $this->article, $srev, $revsSince ) . |
778 | | - ' ' . FlaggedRevsXML::diffToggle() . |
| 781 | + $diffEngine->showDiffStyle(); // add CSS |
| 782 | + $this->isDiffFromStable = true; // alter default review form tags |
| 783 | + return |
| 784 | + FlaggedRevsXML::diffToggle() . |
779 | 785 | "<div id='mw-fr-stablediff'>" . |
780 | 786 | self::getFormattedDiff( $diffBody, $multiNotice, $leftNote, $rightNote ) . |
781 | | - "</div>\n"; |
782 | | - $items[] = $diffHtml; |
783 | | - $html = "<table class='flaggedrevs_viewnotice plainlinks'>"; |
784 | | - foreach ( $items as $item ) { |
785 | | - $html .= '<tr><td>' . $item . '</td></tr>'; |
786 | | - } |
787 | | - $html .= '</table>'; |
788 | | - $this->reviewNotice .= $html; |
789 | | - $diffEngine->showDiffStyle(); // add CSS |
790 | | - $this->isDiffFromStable = true; // alter default review form tags |
791 | | - return true; |
| 787 | + "</div>\n";; |
792 | 788 | } |
793 | | - return false; |
| 789 | + return ''; |
794 | 790 | } |
795 | 791 | |
796 | 792 | // $n number of in-between revs |
— | — | @@ -1308,15 +1304,23 @@ |
1309 | 1305 | /** |
1310 | 1306 | * Adds a notice saying that this revision is pending review |
1311 | 1307 | * @param FlaggedRevision $srev The stable version |
| 1308 | + * @param string $diffToggle either "" or " <diff toggle><diff div>" |
1312 | 1309 | * @return void |
1313 | 1310 | */ |
1314 | | - public function setPendingNotice( FlaggedRevision $srev ) { |
| 1311 | + public function setPendingNotice( FlaggedRevision $srev, $diffToggle = '' ) { |
1315 | 1312 | global $wgLang; |
1316 | 1313 | $this->load(); |
1317 | 1314 | $time = $wgLang->date( $srev->getTimestamp(), true ); |
1318 | | - $pendingNotice = wfMsgExt( 'revreview-pendingnotice', 'parseinline', $time ); |
1319 | | - $this->reviewNotice .= "<div id='mw-fr-reviewnotice' class='flaggedrevs_preview plainlinks'>" . |
1320 | | - $pendingNotice . "</div>"; |
| 1315 | + $revsSince = $this->article->getPendingRevCount(); |
| 1316 | + $msg = $srev->getQuality() |
| 1317 | + ? 'revreview-newest-quality' |
| 1318 | + : 'revreview-newest-basic'; |
| 1319 | + $msg .= ( $revsSince == 0 ) ? '-i' : ''; |
| 1320 | + # Add bar msg to the top of the page... |
| 1321 | + $css = 'flaggedrevs_preview plainlinks'; |
| 1322 | + $msgHTML = wfMsgExt( $msg, 'parseinline', $srev->getRevId(), $time, $revsSince ); |
| 1323 | + $this->reviewNotice .= "<div id='mw-fr-reviewnotice' class='$css'>" . |
| 1324 | + "$msgHTML$diffToggle</div>"; |
1321 | 1325 | } |
1322 | 1326 | |
1323 | 1327 | /** |