Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -1447,43 +1447,43 @@ |
1448 | 1448 | * Add [checked version] and such to left and right side of diff |
1449 | 1449 | */ |
1450 | 1450 | protected static function diffReviewMarkers( FlaggedArticle $article, $oldRev, $newRev ) { |
1451 | | - $form = ''; |
1452 | | - |
| 1451 | + $table = ''; |
1453 | 1452 | $srev = $article->getStableRev(); |
1454 | | - $stableId = $srev ? $srev->getRevId() : 0; |
1455 | 1453 | # Diff between two revisions |
1456 | 1454 | if ( $oldRev && $newRev ) { |
1457 | | - list( $msg, $class ) = self::getDiffRevMsgAndClass( $oldRev, $stableId ); |
1458 | | - $form .= "<table class='fr-diff-ratings'><tr>"; |
1459 | | - $form .= "<td width='50%' align='center'>"; |
1460 | | - $form .= "<span class='$class'>[" . |
| 1455 | + list( $msg, $class ) = self::getDiffRevMsgAndClass( $oldRev, $srev ); |
| 1456 | + $table .= "<table class='fr-diff-ratings'><tr>"; |
| 1457 | + $table .= "<td width='50%' align='center'>"; |
| 1458 | + $table .= "<span class='$class'>[" . |
1461 | 1459 | wfMsgHtml( $msg ) . "]</span>"; |
1462 | 1460 | |
1463 | | - list( $msg, $class ) = self::getDiffRevMsgAndClass( $newRev, $stableId ); |
1464 | | - $form .= "</td><td width='50%' align='center'>"; |
1465 | | - $form .= "<span class='$class'>[" . |
| 1461 | + list( $msg, $class ) = self::getDiffRevMsgAndClass( $newRev, $srev ); |
| 1462 | + $table .= "</td><td width='50%' align='center'>"; |
| 1463 | + $table .= "<span class='$class'>[" . |
1466 | 1464 | wfMsgHtml( $msg ) . "]</span>"; |
1467 | 1465 | |
1468 | | - $form .= "</td></tr></table>\n"; |
| 1466 | + $table .= "</td></tr></table>\n"; |
1469 | 1467 | # New page "diffs" - just one rev |
1470 | 1468 | } elseif ( $newRev ) { |
1471 | | - list( $msg, $class ) = self::getDiffRevMsgAndClass( $newRev, $stableId ); |
1472 | | - $form .= "<table class='fr-diff-ratings'>"; |
1473 | | - $form .= "<tr><td align='center'><span class='$class'>"; |
1474 | | - $form .= '[' . wfMsgHtml( $msg ) . ']'; |
1475 | | - $form .= "</span></td></tr></table>\n"; |
| 1469 | + list( $msg, $class ) = self::getDiffRevMsgAndClass( $newRev, $srev ); |
| 1470 | + $table .= "<table class='fr-diff-ratings'>"; |
| 1471 | + $table .= "<tr><td align='center'><span class='$class'>"; |
| 1472 | + $table .= '[' . wfMsgHtml( $msg ) . ']'; |
| 1473 | + $table .= "</span></td></tr></table>\n"; |
1476 | 1474 | } |
1477 | | - return $form; |
| 1475 | + return $table; |
1478 | 1476 | } |
1479 | 1477 | |
1480 | | - protected static function getDiffRevMsgAndClass( Revision $rev, $stableId ) { |
| 1478 | + protected static function getDiffRevMsgAndClass( |
| 1479 | + Revision $rev, FlaggedRevision $srev = null |
| 1480 | + ) { |
1481 | 1481 | $tier = FlaggedRevs::getRevQuality( $rev->getPage(), $rev->getId() ); |
1482 | 1482 | if ( $tier !== false ) { |
1483 | 1483 | $msg = $tier |
1484 | 1484 | ? 'revreview-hist-quality' |
1485 | 1485 | : 'revreview-hist-basic'; |
1486 | 1486 | } else { |
1487 | | - $msg = ( $stableId && $rev->getId() > $stableId ) |
| 1487 | + $msg = ( $srev && $rev->getTimestamp() > $srev->getRevTimestamp() ) // bug 15515 |
1488 | 1488 | ? 'revreview-hist-pending' |
1489 | 1489 | : 'revreview-hist-draft'; |
1490 | 1490 | } |