r88645 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88644‎ | r88645 | r88646 >
Date:16:07, 23 May 2011
Author:aaron
Status:ok
Tags:
Comment:
* In "template/files changed" diff list, show which ones are unreviewed pages
* Added preview notice to diff review form
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevision.php
@@ -616,7 +616,7 @@
617617 * (b) Current template exists and the "version used" was non-existing (created)
618618 * (c) Current template doesn't exist and the "version used" existed (deleted)
619619 *
620 - * @return array of (template title, rev ID in reviewed version) tuples
 620+ * @return array of (title, rev ID in reviewed version, has stable rev) tuples
621621 */
622622 public function findPendingTemplateChanges() {
623623 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
@@ -667,7 +667,7 @@
668668 }
669669 $deleted = ( !$revIdDraft && $revIdStable ); // later deleted
670670 if ( $deleted || $updated ) {
671 - $tmpChanges[] = array( $title, $revIdStable );
 671+ $tmpChanges[] = array( $title, $revIdStable, (bool)$row->fp_stable );
672672 }
673673 }
674674 return $tmpChanges;
@@ -686,7 +686,7 @@
687687 * (c) Current file doesn't exist and the "version used" existed (deleted)
688688 *
689689 * @param string $noForeign Using 'noForeign' skips foreign file updates (bug 15748)
690 - * @return array of (file title, MW file timestamp in reviewed version) tuples
 690+ * @return array of (title, MW file timestamp in reviewed version, has stable rev) tuples
691691 */
692692 public function findPendingFileChanges( $noForeign = false ) {
693693 if ( FlaggedRevs::inclusionSetting() == FR_INCLUDES_CURRENT ) {
@@ -747,7 +747,7 @@
748748 $deleted = (bool)$tsStable; // included file deleted after review
749749 }
750750 if ( $deleted || $updated ) {
751 - $fileChanges[] = array( $title, $tsStable );
 751+ $fileChanges[] = array( $title, $tsStable, (bool)$row->fr_img_timestamp );
752752 }
753753 }
754754 return $fileChanges;
Index: trunk/extensions/FlaggedRevs/presentation/language/RevisionReview.i18n.php
@@ -75,7 +75,8 @@
7676 'revreview-update-edited-prev' => '<span class="flaggedrevs_important">Your changes are not yet in the stable version. There are previous changes pending review.</span>
7777
7878 Please review all the changes shown below to make your edits appear in the stable version.',
79 - 'revreview-update-includes' => '\'\'\'Some templates/files were updated:\'\'\'',
 79+ 'revreview-update-includes' => '\'\'\'Templates/files updated (unreviewed pages boldened):\'\'\'',
 80+ 'revreview-update-includes-p' => '\'\'\'Templates or files may have been updated. Please preview the page before accepting.\'\'\'',
8081 'revreview-update-use' => '\'\'\'NOTE:\'\'\' The stable version of each of these templates/files is used in the stable version of this page.',
8182
8283 'revreview-reject-header' => 'Reject changes for $1',
Index: trunk/extensions/FlaggedRevs/presentation/FlaggedPageView.php
@@ -1330,7 +1330,7 @@
13311331 * (ii) List any template/file changes pending review
13321332 */
13331333 public function addToDiffView( $diff, $oldRev, $newRev ) {
1334 - global $wgRequest, $wgUser, $wgMemc;
 1334+ global $wgRequest, $wgUser, $wgMemc, $wgParserCacheExpireTime;
13351335 $this->load();
13361336 # Exempt printer-friendly output
13371337 if ( $this->out->isPrintable() ) {
@@ -1361,7 +1361,6 @@
13621362 $changeList = array_merge( $changeList, self::fetchFileChanges( $srev ) );
13631363 # Correct bad cache which said they were not synced...
13641364 if ( !count( $changeList ) ) {
1365 - global $wgParserCacheExpireTime;
13661365 $key = wfMemcKey( 'flaggedrevs', 'includesSynced', $this->article->getId() );
13671366 $data = FlaggedRevs::makeMemcObj( "true" );
13681367 $wgMemc->set( $key, $data, $wgParserCacheExpireTime );
@@ -1395,7 +1394,11 @@
13961395 $changeDiv .= wfMsgExt( $msg, 'parse' );
13971396 }
13981397 # Add include change list...
1399 - if ( count( $changeList ) ) {
 1398+ if ( $this->article->revsArePending() ) { // text changes
 1399+ if ( FlaggedRevs::inclusionSetting() != FR_INCLUDES_CURRENT ) {
 1400+ $changeDiv .= wfMsgExt( 'revreview-update-includes-p', 'parse' );
 1401+ }
 1402+ } elseif ( count( $changeList ) ) { // just inclusion changes
14001403 $changeDiv .= '<p>' .
14011404 wfMsgExt( 'revreview-update-includes', 'parseinline' ) .
14021405 '&#160;' . implode( ', ', $changeList ) . '</p>';
@@ -1544,10 +1547,14 @@
15451548 $diffLinks = array();
15461549 $changes = $frev->findPendingTemplateChanges();
15471550 foreach ( $changes as $tuple ) {
1548 - list( $title, $revIdStable ) = $tuple;
1549 - $diffLinks[] = $skin->makeLinkObj( $title,
 1551+ list( $title, $revIdStable, $hasStable ) = $tuple;
 1552+ $link = $skin->makeLinkObj( $title,
15501553 htmlspecialchars( $title->getPrefixedText() ),
15511554 'diff=cur&oldid=' . (int)$revIdStable );
 1555+ if ( !$hasStable ) {
 1556+ $link = "<strong>$link</strong>";
 1557+ }
 1558+ $diffLinks[] = $link;
15521559 }
15531560 return $diffLinks;
15541561 }
@@ -1560,9 +1567,13 @@
15611568 $diffLinks = array();
15621569 $changes = $frev->findPendingFileChanges( 'noForeign' );
15631570 foreach ( $changes as $tuple ) {
1564 - list( $title, $revIdStable ) = $tuple;
 1571+ list( $title, $revIdStable, $hasStable ) = $tuple;
15651572 // @TODO: change when MW has file diffs
1566 - $diffLinks[] = $skin->makeLinkObj( $title, htmlspecialchars( $title->getPrefixedText() ) );
 1573+ $link = $skin->makeLinkObj( $title, htmlspecialchars( $title->getPrefixedText() ) );
 1574+ if ( !$hasStable ) {
 1575+ $link = "<strong>$link</strong>";
 1576+ }
 1577+ $diffLinks[] = $link;
15671578 }
15681579 return $diffLinks;
15691580 }

Status & tagging log