r78092 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r78091‎ | r78092 | r78093 >
Date:19:42, 8 December 2010
Author:aaron
Status:ok
Tags:
Comment:
Improved getDiffRevMsgAndClass() for bug 15515
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -1447,43 +1447,43 @@
14481448 * Add [checked version] and such to left and right side of diff
14491449 */
14501450 protected static function diffReviewMarkers( FlaggedArticle $article, $oldRev, $newRev ) {
1451 - $form = '';
1452 -
 1451+ $table = '';
14531452 $srev = $article->getStableRev();
1454 - $stableId = $srev ? $srev->getRevId() : 0;
14551453 # Diff between two revisions
14561454 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'>[" .
14611459 wfMsgHtml( $msg ) . "]</span>";
14621460
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'>[" .
14661464 wfMsgHtml( $msg ) . "]</span>";
14671465
1468 - $form .= "</td></tr></table>\n";
 1466+ $table .= "</td></tr></table>\n";
14691467 # New page "diffs" - just one rev
14701468 } 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";
14761474 }
1477 - return $form;
 1475+ return $table;
14781476 }
14791477
1480 - protected static function getDiffRevMsgAndClass( Revision $rev, $stableId ) {
 1478+ protected static function getDiffRevMsgAndClass(
 1479+ Revision $rev, FlaggedRevision $srev = null
 1480+ ) {
14811481 $tier = FlaggedRevs::getRevQuality( $rev->getPage(), $rev->getId() );
14821482 if ( $tier !== false ) {
14831483 $msg = $tier
14841484 ? 'revreview-hist-quality'
14851485 : 'revreview-hist-basic';
14861486 } else {
1487 - $msg = ( $stableId && $rev->getId() > $stableId )
 1487+ $msg = ( $srev && $rev->getTimestamp() > $srev->getRevTimestamp() ) // bug 15515
14881488 ? 'revreview-hist-pending'
14891489 : 'revreview-hist-draft';
14901490 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r78140* Made addToRCQuery() more selective for RCL. The RC hook should really requi...aaron21:28, 9 December 2010
r78166Cleanup return type for getStableRev() given r78092aaron03:23, 10 December 2010
r78557*Made 'excludeLastDays' act on 'totalContentEdits'/'totalCheckedEdits' too...aaron06:03, 18 December 2010
r78649Merged r78044 from trunk ( bug 15515 )pdhanda23:29, 20 December 2010
r78650Merged r78051 from trunk ( bug 15515 )pdhanda23:30, 20 December 2010
r78651Merged r78092 from trunk ( bug 15515 )pdhanda23:32, 20 December 2010
r78729Merged r78166 from trunk (bug 15515)pdhanda19:57, 21 December 2010
r80733MFT first round of FlaggedRevs fixes r78517, r78346, r78319, r78293, r78226, ...demon23:56, 21 January 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r78044* (bug 15515) Fixed history highlighting and getPendingRevCount() to handle t...aaron05:17, 8 December 2010
r78051*(bug 15515) Fixed addToContribsLine() and addDraftTab() query w.r.t page imp...aaron07:31, 8 December 2010

Status & tagging log