r58994 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r58993‎ | r58994 | r58995 >
Date:00:46, 13 November 2009
Author:aaron
Status:ok
Tags:
Comment:
bug 21438 Colorcode Special:UnreviewedPages by age
Modified paths:
  • /trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/specialpages/UnreviewedPages_body.php
@@ -95,7 +95,7 @@
9696 $title = Title::newFromRow( $row );
9797 $link = $this->skin->makeKnownLinkObj( $title, null, 'redirect=no&reviewform=1' );
9898 $hist = $this->skin->makeKnownLinkObj( $title, wfMsgHtml('hist'), 'action=history' );
99 - $css = $stxt = $review = $underReview = '';
 99+ $stxt = $review = $underReview = $watching = '';
100100 if( !is_null($size = $row->page_len) ) {
101101 $stxt = ($size == 0)
102102 ? wfMsgHtml('historyempty')
@@ -120,14 +120,15 @@
121121 }
122122 if( $wgUser->isAllowed('unwatchedpages') ) {
123123 $uw = self::usersWatching( $title );
124 - $watching = $uw ?
125 - wfMsgExt( 'unreviewed-watched', array('parsemag'), $uw ) : wfMsgHtml( 'unreviewed-unwatched' );
126 - $watching = " $watching";
127 - // Oh-noes!
128 - $css = $uw ? "" : " class='fr-unreviewed-unwatched'";
 124+ $watching = $uw
 125+ ? wfMsgExt( 'unreviewed-watched', array('parsemag'), $uw )
 126+ : wfMsgHtml( 'unreviewed-unwatched');
 127+ $watching = " $watching"; // Oh-noes!
129128 } else {
130 - $watching = "";
 129+ $uw = -1;
131130 }
 131+ $css = self::getLineClass( $hours, $uw );
 132+ $css = $css ? " class='$css'" : "";
132133 $pageId = isset($row->page_id) ? $row->page_id : $row->qc_value;
133134 $key = wfMemcKey( 'unreviewedPages', 'underReview', $pageId );
134135 $val = $wgMemc->get( $key );
@@ -172,6 +173,17 @@
173174 return $count;
174175 }
175176
 177+ protected static function getLineClass( $hours, $uw ) {
 178+ if( $uw == 0 )
 179+ return 'fr-unreviewed-unwatched';
 180+ else if( $hours > 20*24 )
 181+ return 'fr-pending-long2';
 182+ else if( $hours > 7*24 )
 183+ return 'fr-pending-long';
 184+ else
 185+ return "";
 186+ }
 187+
176188 /**
177189 * There may be many pages, most of which are reviewed
178190 */

Status & tagging log