r110421 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110420‎ | r110421 | r110422 >
Date:20:03, 31 January 2012
Author:gregchiasson
Status:ok
Tags:aft 
Comment:
AFT: Always show the abuse count to anyone who can administer the feedback page - piggybacks off of the can hide permission now, which seemed reasonable - and never show the count to anyone who cant (regular users and anonymous).
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.i18n.php
@@ -90,6 +90,7 @@
9191 'articlefeedbackv5-form-header' => 'Feedback #$1, at $2',
9292 'articlefeedbackv5-form1-header-found' => '{{GENDER:$1|$1}} found what they were looking for',
9393 'articlefeedbackv5-form1-header-not-found' => '{{GENDER:$1|$1}} did not find what they were looking for',
 94+ 'articlefeedbackv5-form1-header-left-comment' => '{{GENDER:$1|$1}} left a comment',
9495 'articlefeedbackv5-form2-header-praise' => '{{GENDER:$1|$1}} had a praise:',
9596 'articlefeedbackv5-form2-header-problem' => '{{GENDER:$1|$1}} had a problem:',
9697 'articlefeedbackv5-form2-header-question' => '{{GENDER:$1|$1}} had a question:',
@@ -100,6 +101,7 @@
101102 'articlefeedbackv5-form-not-shown' => '{{GENDER:$1|$1}} was not shown a feedback form.',
102103 'articlefeedbackv5-form-invalid' => 'Invalid feedback form ID.',
103104 'articlefeedbackv5-abuse-saved' => 'Flagged as abuse ($1)',
 105+ 'articlefeedbackv5-abuse-saved-masked' => 'Flagged as abuse',
104106 'articlefeedbackv5-oversight-saved' => 'Marked for oversight',
105107 'articlefeedbackv5-unoversight-saved' => 'Oversight flag removed',
106108 'articlefeedbackv5-error-loading-feedback' => 'Error loading feedback',
@@ -348,6 +350,8 @@
349351 * $1 is a username.',
350352 'articlefeedbackv5-form1-header-not-found' => 'Parameters
351353 * $1 is a username.',
 354+ 'articlefeedbackv5-form1-header-left-comment' => 'Parameters
 355+* $1 is a username.',
352356 'articlefeedbackv5-form2-header-praise' => 'Parameters:
353357 * $1 is a user name.',
354358 'articlefeedbackv5-form2-header-problem' => 'Parameters:
Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -495,9 +495,17 @@
496496 // Abusive
497497 } else if ( 'abuse' == type ) {
498498 if ( dir > 0 ) {
499 - $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 499+ if( mw.config.get( 'afCanEdit' ) == 1 ) {
 500+ $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 501+ } else {
 502+ $l.text( mw.msg( 'articlefeedbackv5-abuse-saved-masked', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 503+ }
500504 } else {
501 - $l.text( mw.msg( 'articlefeedbackv5-form-abuse', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 505+ if( mw.config.get( 'afCanEdit' ) == 1 ) {
 506+ $l.text( mw.msg( 'articlefeedbackv5-form-abuse', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 507+ } else {
 508+ $l.text( mw.msg( 'articlefeedbackv5-form-abuse-masked', data['articlefeedbackv5-flag-feedback'].abuse_count ) );
 509+ }
502510 }
503511 $l.attr( 'rel', data['articlefeedbackv5-flag-feedback'].abuse_count );
504512 if ( data['articlefeedbackv5-flag-feedback'].abusive ) {
@@ -594,7 +602,11 @@
595603 }
596604 if ( activity.abuse ) {
597605 var $l = $( this ).find( '#articleFeedbackv5-abuse-link-' + id );
598 - $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', $l.attr( 'rel' ) ) );
 606+ if( mw.config.get( 'afCanEdit' ) == 1 ) {
 607+ $l.text( mw.msg( 'articlefeedbackv5-abuse-saved', $l.attr( 'rel' ) ) );
 608+ } else {
 609+ $l.text( mw.msg( 'articlefeedbackv5-abuse-saved-masked', $l.attr( 'rel' ) ) );
 610+ }
599611 }
600612 }
601613 if ( $( this ).hasClass( 'articleFeedbackv5-feedback-hidden' ) ) {
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php
@@ -57,7 +57,7 @@
5858 * @param $param string the parameter passed in the url
5959 */
6060 public function execute( $param ) {
61 - global $wgArticleFeedbackv5DashboardCategory;
 61+ global $wgArticleFeedbackv5DashboardCategory, $wgUser;
6262 $out = $this->getOutput();
6363
6464 // set robot policy
@@ -185,6 +185,11 @@
186186 # }
187187
188188 $out->addJsConfigVars( 'afPageId', $pageId );
 189+ // Only show the abuse counts to editors (ie, anyone allowed to
 190+ // hide content).
 191+ if ( $wgUser->isAllowed( 'aftv5-see-hidden-feedback' ) ) {
 192+ $out->addJsConfigVars( 'afCanEdit', 1 );
 193+ }
189194 $out->addModules( 'ext.articleFeedbackv5.dashboard' );
190195
191196 $sortLabels = array();
Index: trunk/extensions/ArticleFeedbackv5/ArticleFeedbackv5.hooks.php
@@ -167,7 +167,9 @@
168168 'articlefeedbackv5-invalid-feedback-id',
169169 'articlefeedbackv5-invalid-feedback-flag',
170170 'articlefeedbackv5-form-abuse',
 171+ 'articlefeedbackv5-form-abuse-masked',
171172 'articlefeedbackv5-abuse-saved',
 173+ 'articlefeedbackv5-abuse-saved-masked',
172174 'articlefeedbackv5-form-hide',
173175 'articlefeedbackv5-form-unhide',
174176 'articlefeedbackv5-form-delete',

Status & tagging log