r109645 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109644‎ | r109645 | r109646 >
Date:21:01, 20 January 2012
Author:gregchiasson
Status:ok (Comments)
Tags:aft 
Comment:
AFT5 feedback page- Remove extra title line, make permalink changes as requested, reformat timestamp, add working link to diff page, make bug fixes in JS.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)
  • /trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/modules/jquery.articleFeedbackv5/jquery.articleFeedbackv5.special.js
@@ -79,7 +79,7 @@
8080 * Binds events for each of the controls
8181 */
8282 $.articleFeedbackv5special.setBinds = function() {
83 - $( '#articleFeedbackv5-filter' ).bind( 'change', function( e ) {
 83+ $( '#articleFeedbackv5-filter-select' ).bind( 'change', function( e ) {
8484 $.articleFeedbackv5special.filter = $(this).val();
8585 $.articleFeedbackv5special.continue = null;
8686 $.articleFeedbackv5special.loadFeedback( true );
@@ -93,15 +93,15 @@
9494 $.articleFeedbackv5special.sortDirection = 'desc';
9595 $.articleFeedbackv5special.sort = id;
9696 $.articleFeedbackv5special.continue = null;
97 - $.articleFeedbackv5special.loadFeedback( true );
9897
9998 // unless we're flipping the direction on the current sort.
100 -console.log('id is ' + id + ', old id is ' + oldId);
10199 if( id == oldId
102100 && $.articleFeedbackv5special.sortDirection == 'desc') {
103101 $.articleFeedbackv5special.sortDirection = 'asc';
104102 }
105 - // draw arrow
 103+
 104+ $.articleFeedbackv5special.loadFeedback( true );
 105+ // draw arrow and load feedback posts
106106 $.articleFeedbackv5special.drawSortArrow();
107107
108108 return false;
@@ -125,10 +125,13 @@
126126 } );
127127 $( '.articleFeedbackv5-helpful-link' ).live( 'click', function( e ) {
128128 $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-helpful-link-' ), 'helpful' );
 129+ $(this).addClass('active');
 130+
129131 return false;
130132 } );
131133 $( '.articleFeedbackv5-unhelpful-link' ).live( 'click', function( e ) {
132134 $.articleFeedbackv5special.flagFeedback( $.articleFeedbackv5special.stripID( this, 'articleFeedbackv5-unhelpful-link-' ), 'unhelpful' );
 135+ $(this).addClass('active');
133136 return false;
134137 } );
135138 }
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -145,7 +145,7 @@
146146 $rows = $dbr->select(
147147 array( 'aft_article_feedback', 'aft_article_answer',
148148 'aft_article_field', 'aft_article_field_option',
149 - 'user'
 149+ 'user', 'page'
150150 ),
151151 array( 'af_id', 'af_bucket_id', 'afi_name', 'afo_name',
152152 'aa_response_text', 'aa_response_boolean',
@@ -154,13 +154,17 @@
155155 'af_user_ip', 'af_hide_count', 'af_abuse_count',
156156 'af_helpful_count', 'af_unhelpful_count', 'af_delete_count',
157157 '(SELECT COUNT(*) FROM revision WHERE rev_id > af_revision_id AND rev_page = '.( integer ) $pageId.') AS age',
158 - 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness'
 158+ 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness',
 159+ 'page_latest', 'af_revision_id'
159160 ),
160161 array( 'af_id' => $ids ),
161162 __METHOD__,
162163 array( 'ORDER BY' => $order ),
163164 array(
164 - 'user' => array(
 165+ 'page' => array(
 166+ 'JOIN', 'page_id = af_page_id'
 167+ ),
 168+ 'user' => array(
165169 'LEFT JOIN', 'user_id = af_user_id'
166170 ),
167171 'aft_article_field' => array(
@@ -243,6 +247,7 @@
244248 }
245249
246250 protected function renderFeedback( $record ) {
 251+ global $wgArticlePath;
247252 switch( $record[0]->af_bucket_id ) {
248253 case 1: $content .= $this->renderBucket1( $record ); break;
249254 case 2: $content .= $this->renderBucket2( $record ); break;
@@ -268,19 +273,37 @@
269274 $details = Html::openElement( 'div', array(
270275 'class' => 'articleFeedbackv5-comment-details'
271276 ) )
272 - . Html::element( 'div', array(
 277+ . Html::openElement( 'div', array(
273278 'class' => 'articleFeedbackv5-comment-details-date'
274 - ), date( 'r', $record[0]->af_created ) )
275 - . Html::openElement( 'div', array(
276 - 'class' => 'articleFeedbackv5-comment-details-permalink'
277 - ) )
 279+ ) )
278280 .Html::element( 'a', array(
279281 'href' => "#id=$id"
280 - ), wfMessage( 'articlefeedbackv5-comment-link' ) )
 282+ ), date( 'M j, Y H:i', strtotime($record[0]->af_created) ) )
281283 . Html::closeElement( 'div' )
282 - . Html::element( 'div', array(
 284+# Remove for now, pending feedback.
 285+# . Html::openElement( 'div', array(
 286+# 'class' => 'articleFeedbackv5-comment-details-permalink'
 287+# ) )
 288+# .Html::element( 'a', array(
 289+# 'href' => "#id=$id"
 290+# ), wfMessage( 'articlefeedbackv5-comment-link' ) )
 291+# . Html::closeElement( 'div' )
 292+
 293+ . Html::openElement( 'div', array(
283294 'class' => 'articleFeedbackv5-comment-details-updates'
284 - ), wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ) )
 295+ ) )
 296+ . Linker::link(
 297+ Title::newFromText( 'Greg' ),
 298+ wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ),
 299+ array(),
 300+ array(
 301+ 'action' => 'historysubmit',
 302+ 'diff' => $record[0]->page_latest,
 303+ 'oldid' => $record[0]->af_revision_id
 304+ )
 305+ )
 306+# ), wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ) )
 307+ . Html::closeElement( 'div' )
285308 . Html::closeElement( 'div' );
286309 ;
287310
Index: trunk/extensions/ArticleFeedbackv5/SpecialArticleFeedbackv5.php
@@ -128,7 +128,6 @@
129129 # $out->addWikiMsg( 'articlefeedbackv5-overall-rating', $rating );
130130 # }
131131
132 - $out->addWikiMsg( 'articlefeedbackv5-special-title' );
133132
134133 $out->addJsConfigVars( 'afPageId', $pageId );
135134 $out->addModules( 'jquery.articleFeedbackv5.special' );
@@ -160,7 +159,7 @@
161160 $opts[ (string) $key ] = $filter;
162161 }
163162
164 - $filterSelect = new XmlSelect( false, 'articleFeedbackv5-filter' );
 163+ $filterSelect = new XmlSelect( false, 'articleFeedbackv5-filter-select' );
165164 $filterSelect->addOptions( $opts );
166165
167166 $out->addHTML(

Follow-up revisions

RevisionCommit summaryAuthorDate
r110398AFT5 remove unused global variables on special page per comments on r109645.gregchiasson16:12, 31 January 2012

Comments

#Comment by Catrope (talk | contribs)   06:10, 31 January 2012
+		global $wgArticlePath;

Unused.

Status & tagging log