r65106 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r65105‎ | r65106 | r65107 >
Date:03:06, 16 April 2010
Author:aaron
Status:deferred
Tags:
Comment:
* Made "pending edits" always link to diff-to-stable (not just unchecked revs in some cases). Show only if the edit is pending.
* Added "[unchecked]" text to RC to denote unreviewed pages
* Styled the RC review links to made them stand out
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -229,6 +229,7 @@
230230
231231 'revreview-reviewlink' => 'pending edits',
232232 'revreview-reviewlink-title' => 'View diff of all pending changes',
 233+ 'revreview-unreviewedpage' => 'unchecked page',
233234
234235 'tooltip-ca-current' => 'View this page with pending changes',
235236 'tooltip-ca-stable' => 'View the published version of this page',
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -1784,9 +1784,8 @@
17851785 public static function addToRCQuery( &$conds, &$tables, &$join_conds, $opts ) {
17861786 global $wgUser;
17871787 if ( $wgUser->isAllowed( 'review' ) ) {
1788 - $tables[] = 'flaggedpage_pending';
1789 - $join_conds['flaggedpage_pending'] = array( 'LEFT JOIN',
1790 - 'fpp_page_id = rc_cur_id AND fpp_quality = ' . FR_SIGHTED );
 1788+ $tables[] = 'flaggedpages';
 1789+ $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
17911790 }
17921791 return true;
17931792 }
@@ -1794,10 +1793,9 @@
17951794 public static function addToWatchlistQuery( &$conds, &$tables, &$join_conds, &$fields ) {
17961795 global $wgUser;
17971796 if ( $wgUser->isAllowed( 'review' ) ) {
1798 - $fields[] = 'fpp_rev_id';
1799 - $tables[] = 'flaggedpage_pending';
1800 - $join_conds['flaggedpage_pending'] = array( 'LEFT JOIN',
1801 - 'fpp_page_id = rc_cur_id AND fpp_quality = ' . FR_SIGHTED );
 1797+ $fields[] = 'fp_stable';
 1798+ $tables[] = 'flaggedpages';
 1799+ $join_conds['flaggedpages'] = array( 'LEFT JOIN', 'fp_page_id = rc_cur_id' );
18021800 }
18031801 return true;
18041802 }
@@ -1920,20 +1918,33 @@
19211919 public static function addToChangeListLine(
19221920 &$list, &$articlelink, &$s, &$rc, $unpatrolled, $watched
19231921 ) {
1924 - if ( empty( $rc->mAttribs['fpp_rev_id'] ) ) {
1925 - return true; // page is not listed in pending edit table
1926 - }
1927 - if ( !FlaggedRevs::inReviewNamespace( $rc->getTitle() ) ) {
 1922+ $title = $rc->getTitle(); // convenience
 1923+ if ( !FlaggedRevs::inReviewNamespace( $title )
 1924+ || empty( $rc->mAttribs['rc_this_oldid'] ) )
 1925+ {
19281926 return true; // confirm that page is in reviewable namespace
19291927 }
1930 - $rlink = $list->skin->link(
1931 - $rc->getTitle(),
1932 - wfMsgHtml( 'revreview-reviewlink' ),
1933 - array( 'title' => wfMsg( 'revreview-reviewlink-title' ) ),
1934 - array( 'oldid' => $rc->mAttribs['fpp_rev_id'], 'diff' => 'cur' )
1935 - );
1936 - $rlink = wfMsgHtml( 'parentheses', $rlink );
1937 - $articlelink .= " <span class=\"mw-fr-reviewlink\">$rlink</span>";
 1928+ $rlink = '';
 1929+ // page is not reviewed
 1930+ if ( empty( $rc->mAttribs['fp_stable'] ) ) {
 1931+ // Is this a config were pages start off reviewable?
 1932+ if ( !FlaggedRevs::stableOnlyIfConfigured() ) {
 1933+ $rlink = wfMsgHtml( 'revreview-unreviewedpage' );
 1934+ $css = 'flaggedrevs-unreviewed';
 1935+ }
 1936+ // page is reviewed and has pending edits
 1937+ } elseif ( $rc->mAttribs['fp_stable'] < $rc->mAttribs['rc_this_oldid'] ) {
 1938+ $rlink = $list->skin->link(
 1939+ $title,
 1940+ wfMsgHtml( 'revreview-reviewlink' ),
 1941+ array( 'title' => wfMsg( 'revreview-reviewlink-title' ) ),
 1942+ array( 'oldid' => $rc->mAttribs['fp_stable'], 'diff' => 'cur' )
 1943+ );
 1944+ $css = 'flaggedrevs-pending';
 1945+ }
 1946+ if ( $rlink != '' ) {
 1947+ $articlelink .= " <span class=\"mw-fr-reviewlink $css\">[$rlink]</span>";
 1948+ }
19381949 return true;
19391950 }
19401951

Status & tagging log