Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticle.php |
— | — | @@ -215,6 +215,14 @@ |
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
| 219 | + * Are template/file changes and ONLY template/file changes pending? |
| 220 | + * @return bool |
| 221 | + */ |
| 222 | + public function onlyTemplatesOrFilesPending() { |
| 223 | + return ( !$this->revsArePending() && !$this->stableVersionIsSynced() ); |
| 224 | + } |
| 225 | + |
| 226 | + /** |
219 | 227 | * Is this page less open than the site defaults? |
220 | 228 | * @return bool |
221 | 229 | */ |
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevision.php |
— | — | @@ -391,7 +391,7 @@ |
392 | 392 | * Note: here for convenience |
393 | 393 | * @return bool |
394 | 394 | */ |
395 | | - public function isCurrent() { |
| 395 | + public function revIsCurrent() { |
396 | 396 | $rev = $this->getRevision(); // corresponding revision |
397 | 397 | return ( $rev ? $rev->isCurrent() : false ); |
398 | 398 | } |
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedRevs.hooks.php |
— | — | @@ -1608,6 +1608,7 @@ |
1609 | 1609 | # Highlight unchecked content |
1610 | 1610 | $queryInfo['tables'][] = 'flaggedpages'; |
1611 | 1611 | $queryInfo['fields'][] = 'fp_stable'; |
| 1612 | + $queryInfo['fields'][] = 'fp_pending_since'; |
1612 | 1613 | $queryInfo['join_conds']['flaggedpages'] = array( 'LEFT JOIN', "fp_page_id = rev_page" ); |
1613 | 1614 | return true; |
1614 | 1615 | } |
— | — | @@ -1744,7 +1745,9 @@ |
1745 | 1746 | } elseif ( isset( $row->fr_quality ) ) { |
1746 | 1747 | $ret = '<span class="' . FlaggedRevsXML::getQualityColor( $row->fr_quality ) . |
1747 | 1748 | '">' . $ret . '</span>'; |
1748 | | - } elseif ( isset( $row->fp_stable ) && $row->rev_id > $row->fp_stable ) { |
| 1749 | + } elseif ( isset( $row->fp_pending_since ) |
| 1750 | + && $row->rev_timestamp >= $row->fp_pending_since ) // bug 15515 |
| 1751 | + { |
1749 | 1752 | $ret = '<span class="flaggedrevs-pending">' . $ret . '</span>'; |
1750 | 1753 | } elseif ( !isset( $row->fp_stable ) ) { |
1751 | 1754 | $ret = '<span class="flaggedrevs-unreviewed">' . $ret . '</span>'; |
Index: branches/priyanka-wmf-fixes/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -1188,10 +1188,20 @@ |
1189 | 1189 | // We are looking a the stable version or an old reviewed one |
1190 | 1190 | $tabs['read']['class'] = 'selected'; |
1191 | 1191 | } elseif ( self::isViewAction( $action ) ) { |
1192 | | - // Are we looking at a draft/current revision? |
1193 | | - // Note: there may *just* be template/file changes. |
1194 | | - if ( $wgOut->getRevisionId() >= $srev->getRevId() ) { |
| 1192 | + $ts = null; |
| 1193 | + if ( $wgOut->getRevisionId() ) { // @TODO: avoid same query in Skin.php |
| 1194 | + $ts = ( $wgOut->getRevisionId() == $this->article->getLatest() ) |
| 1195 | + ? $this->article->getTimestamp() // skip query |
| 1196 | + : Revision::getTimestampFromId( $title, $wgOut->getRevisionId() ); |
| 1197 | + } |
| 1198 | + // Are we looking at a pending revision? |
| 1199 | + if ( $ts > $srev->getRevTimestamp() ) { // bug 15515 |
1195 | 1200 | $tabs['draft']['class'] .= ' selected'; |
| 1201 | + // Are there *just* pending template/file changes. |
| 1202 | + } elseif ( $this->article->onlyTemplatesOrFilesPending() |
| 1203 | + && $wgOut->getRevisionId() == $this->article->getStable() ) |
| 1204 | + { |
| 1205 | + $tabs['draft']['class'] .= ' selected'; |
1196 | 1206 | // Otherwise, fallback to regular tab behavior |
1197 | 1207 | } else { |
1198 | 1208 | $tabs['read']['class'] = 'selected'; |