Index: trunk/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: trunk/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: trunk/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: trunk/extensions/FlaggedRevs/FlaggedArticleView.php |
— | — | @@ -1185,10 +1185,20 @@ |
1186 | 1186 | // We are looking a the stable version or an old reviewed one |
1187 | 1187 | $tabs['read']['class'] = 'selected'; |
1188 | 1188 | } elseif ( self::isViewAction( $action ) ) { |
1189 | | - // Are we looking at a draft/current revision? |
1190 | | - // Note: there may *just* be template/file changes. |
1191 | | - if ( $wgOut->getRevisionId() >= $srev->getRevId() ) { |
| 1189 | + $ts = null; |
| 1190 | + if ( $wgOut->getRevisionId() ) { // @TODO: avoid same query in Skin.php |
| 1191 | + $ts = ( $wgOut->getRevisionId() == $this->article->getLatest() ) |
| 1192 | + ? $this->article->getTimestamp() // skip query |
| 1193 | + : Revision::getTimestampFromId( $title, $wgOut->getRevisionId() ); |
| 1194 | + } |
| 1195 | + // Are we looking at a pending revision? |
| 1196 | + if ( $ts > $srev->getRevTimestamp() ) { // bug 15515 |
1192 | 1197 | $tabs['draft']['class'] .= ' selected'; |
| 1198 | + // Are there *just* pending template/file changes. |
| 1199 | + } elseif ( $this->article->onlyTemplatesOrFilesPending() |
| 1200 | + && $wgOut->getRevisionId() == $this->article->getStable() ) |
| 1201 | + { |
| 1202 | + $tabs['draft']['class'] .= ' selected'; |
1193 | 1203 | // Otherwise, fallback to regular tab behavior |
1194 | 1204 | } else { |
1195 | 1205 | $tabs['read']['class'] = 'selected'; |