r76895 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76894‎ | r76895 | r76896 >
Date:18:48, 17 November 2010
Author:pdhanda
Status:ok
Tags:
Comment:
Separated setPendingNotice from setReviewNotes. Addresses Aaron's concern in r76835
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -385,8 +385,10 @@
386386 $quality = FlaggedRevs::isQuality( $flags );
387387 # Get stable version sync status
388388 $synced = $this->article->stableVersionIsSynced();
389 - $this->setReviewNotes( $srev, $synced ); // Still the same
390 - if ( !$synced ) {
 389+ if ( $synced ) {
 390+ $this->setReviewNotes( $srev ); // Still the same
 391+ } else {
 392+ $this->setPendingNotice( $srev );
391393 $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs)
392394 }
393395 # If they are synced, do special styling
@@ -1249,26 +1251,31 @@
12501252 * @param FlaggedRevision $frev
12511253 * @return string, revision review notes
12521254 */
1253 - public function setReviewNotes( $frev, $synced = true ) {
1254 - global $wgUser, $wgLang;
 1255+ public function setReviewNotes( $frev ) {
 1256+ global $wgUser;
12551257 $this->load();
1256 -
1257 - if ( $synced ) {
1258 - if ( $frev && FlaggedRevs::allowComments() && $frev->getComment() != '' ) {
1259 - $this->reviewNotes = "<br /><div class='flaggedrevs_notes plainlinks'>";
1260 - $this->reviewNotes .= wfMsgExt( 'revreview-note', array( 'parseinline' ),
1261 - User::whoIs( $frev->getUser() ) );
1262 - $this->reviewNotes .= '<br /><i>' .
1263 - $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
1264 - }
1265 - } else {
1266 - $time = $wgLang->date( $frev->getTimestamp(), true );
1267 - $pendingNotice = wfMsgExt( 'revreview-pendingnotice', array( 'parseinline' ), $time );
1268 - $this->reviewNotice = "<div id='mw-fr-reviewnotice' " .
1269 - "class='flaggedrevs_preview plainlinks'>" . $pendingNotice . "</div>";
 1258+ if ( $frev && FlaggedRevs::allowComments() && $frev->getComment() != '' ) {
 1259+ $this->reviewNotes = "<br /><div class='flaggedrevs_notes plainlinks'>";
 1260+ $this->reviewNotes .= wfMsgExt( 'revreview-note', array( 'parseinline' ),
 1261+ User::whoIs( $frev->getUser() ) );
 1262+ $this->reviewNotes .= '<br /><i>' .
 1263+ $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
12701264 }
12711265 }
12721266
 1267+/**
 1268+ * @param FlaggedRevision $frev
 1269+ * Adds a notice saying that this is a revision that is pending review
 1270+ */
 1271+ public function setPendingNotice( $frev ) {
 1272+ global $wgLang;
 1273+ $this->load();
 1274+ $time = $wgLang->date( $frev->getTimestamp(), true );
 1275+ $pendingNotice = wfMsgExt( 'revreview-pendingnotice', array( 'parseinline' ), $time );
 1276+ $this->reviewNotice .= "<div id='mw-fr-reviewnotice' class='flaggedrevs_preview plainlinks'>" .
 1277+ $pendingNotice . "</div>";
 1278+ }
 1279+
12731280
12741281 /**
12751282 * When viewing a diff:

Follow-up revisions

RevisionCommit summaryAuthorDate
r76896Merged r76895. Separated setPendingNotice from setReviewNotes. Addresses Aaro...pdhanda18:49, 17 November 2010
r77114MFT r76866, r76895, r76902, r76924-r77113demon21:18, 22 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76835Changed the revcontents-getcontents message as per feedback from r76353. Adde...pdhanda20:51, 16 November 2010

Status & tagging log