r76835 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r76834‎ | r76835 | r76836 >
Date:20:51, 16 November 2010
Author:pdhanda
Status:resolved (Comments)
Tags:
Comment:
Changed the revcontents-getcontents message as per feedback from r76353. Added a notice when viewing the pending version - bug 25299. Changed edit notice styles to match.
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedArticleView.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/client/flaggedrevs.css (modified) (history)
  • /trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/language/FlaggedRevs.i18n.php
@@ -42,7 +42,7 @@
4343 'group-autoreview-member' => 'autochecked users',
4444 'grouppage-autoreview' => '{{ns:project}}:Autochecked users',
4545 'revcontents-error' => 'Unable to get content.',
46 - 'revcontents-getcontents' => 'Click <a href="$1" >here</a> to view this revision.',
 46+ 'revcontents-getcontents' => '<a href="$1" >View this revision</a>',
4747 'revcontents-waiting' => 'Waiting for content',
4848 'revreview-hist-draft' => 'unchecked revision',
4949 'revreview-hist-pending' => 'pending revision',
@@ -112,6 +112,7 @@
113113 'revreview-draft-title' => 'Pending changes are displayed on this page',
114114 'revreview-edit' => 'Edit',
115115 'revreview-editnotice' => '\'\'\'Your changes will be displayed to readers once an authorized user reviews them. ([[{{MediaWiki:Validationpage}}|help]])\'\'\'',
 116+ 'revreview-pendingnotice' => '\'\'\'This is a [[w:Wikipedia:Pending changes|pending revision]] of this page. It was last accepted at <i>$1</i>. It may differ slightly from the accepted revision.\'\'\'',
116117 'revreview-check-flag-p' => 'Accept this version (includes $1 pending {{PLURAL:$1|change|changes}})',
117118 'revreview-check-flag-p-title' => 'Accept the result of the pending changes and the changes you made here. Use this only if you have already seen the entire pending changes diff.',
118119 'revreview-check-flag-u' => 'Accept this unreviewed page',
Index: trunk/extensions/FlaggedRevs/FlaggedArticleView.php
@@ -385,9 +385,8 @@
386386 $quality = FlaggedRevs::isQuality( $flags );
387387 # Get stable version sync status
388388 $synced = $this->article->stableVersionIsSynced();
389 - if ( $synced ) {
390 - $this->setReviewNotes( $srev ); // Still the same
391 - } else {
 389+ $this->setReviewNotes( $srev, $synced ); // Still the same
 390+ if ( !$synced ) {
392391 $this->maybeShowTopDiff( $srev, $quality ); // user may want diff (via prefs)
393392 }
394393 # If they are synced, do special styling
@@ -1248,17 +1247,26 @@
12491248 * @param FlaggedRevision $frev
12501249 * @return string, revision review notes
12511250 */
1252 - public function setReviewNotes( $frev ) {
1253 - global $wgUser;
 1251+ public function setReviewNotes( $frev, $synced = true ) {
 1252+ global $wgUser, $wgLang;
12541253 $this->load();
1255 - if ( $frev && FlaggedRevs::allowComments() && $frev->getComment() != '' ) {
1256 - $this->reviewNotes = "<br /><div class='flaggedrevs_notes plainlinks'>";
1257 - $this->reviewNotes .= wfMsgExt( 'revreview-note', array( 'parseinline' ),
1258 - User::whoIs( $frev->getUser() ) );
1259 - $this->reviewNotes .= '<br /><i>' .
1260 - $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
 1254+
 1255+ if ( $synced ) {
 1256+ if ( $frev && FlaggedRevs::allowComments() && $frev->getComment() != '' ) {
 1257+ $this->reviewNotes = "<br /><div class='flaggedrevs_notes plainlinks'>";
 1258+ $this->reviewNotes .= wfMsgExt( 'revreview-note', array( 'parseinline' ),
 1259+ User::whoIs( $frev->getUser() ) );
 1260+ $this->reviewNotes .= '<br /><i>' .
 1261+ $wgUser->getSkin()->formatComment( $frev->getComment() ) . '</i></div>';
 1262+ }
 1263+ } else {
 1264+ $time = $wgLang->date( $frev->getTimestamp(), true );
 1265+ $pendingNotice = wfMsgExt( 'revreview-pendingnotice', array( 'parseinline' ), $time );
 1266+ $this->reviewNotice = "<div id='mw-fr-reviewnotice' " .
 1267+ "class='flaggedrevs_preview plainlinks'>" . $pendingNotice . "</div>";
12611268 }
12621269 }
 1270+
12631271
12641272 /**
12651273 * When viewing a diff:
Index: trunk/extensions/FlaggedRevs/client/flaggedrevs.css
@@ -32,7 +32,7 @@
3333 table.flaggedrevs_editnotice,
3434 table.flaggedrevs_viewnotice {
3535 padding: 3px;
36 - border: 2px solid #aaa;
 36+ border: 2px solid #6cc8f3;
3737 background-color: #f9f9f9;
3838 text-align: left;
3939 width: 100%;
@@ -41,7 +41,7 @@
4242
4343 div.flaggedrevs_diffnotice,
4444 div.flaggedrevs_preview {
45 - border: 1px solid #aaa;
 45+ border: 1px solid #a7d7f9;
4646 padding: 5px;
4747 text-align: center;
4848 clear: both;
@@ -51,8 +51,8 @@
5252 background-color: #f9f9f9;
5353 }
5454 div.flaggedrevs_preview {
55 - background-color: #f9f9f9;
56 - color: #8b0000;
 55+ background-color: #eaf2fd;
 56+ color: black;
5757 }
5858
5959 span.flaggedrevs_important {

Follow-up revisions

RevisionCommit summaryAuthorDate
r76836Follow-up r76835: Keep meesages project neutral. ...raymond21:06, 16 November 2010
r76895Separated setPendingNotice from setReviewNotes. Addresses Aaron's concern in ...pdhanda18:48, 17 November 2010
r76896Merged r76895. Separated setPendingNotice from setReviewNotes. Addresses Aaro...pdhanda18:49, 17 November 2010
r77342Fix r76835: only the "view contents" link should have plainlinks, not the pre...aaron19:38, 26 November 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r76353Better error handling. Fixed how css and js file are included. Followup to r7...pdhanda23:32, 8 November 2010

Comments

#Comment by Aaron Schulz (talk | contribs)   02:29, 17 November 2010

setReviewNotes() should not be handling two different concerns like this. The function to add the "this is a pending rev" should be separate. This would also avoid the misleading $synced parameter too.

Status & tagging log