r109844 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r109843‎ | r109844 | r109845 >
Date:19:06, 23 January 2012
Author:gregchiasson
Status:resolved (Comments)
Tags:aft 
Comment:
AFT5 feedback page - HTML fixes, and resolve a TODO on the 'edits since' link.
Modified paths:
  • /trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php
@@ -155,7 +155,7 @@
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',
158158 'CONVERT(af_helpful_count, SIGNED) - CONVERT(af_unhelpful_count, SIGNED) AS net_helpfulness',
159 - 'page_latest', 'af_revision_id'
 159+ 'page_latest', 'af_revision_id', 'page_title'
160160 ),
161161 array( 'af_id' => $ids ),
162162 __METHOD__,
@@ -293,8 +293,7 @@
294294 'class' => 'articleFeedbackv5-comment-details-updates'
295295 ) )
296296 . Linker::link(
297 -#TODO: take out that hardcoded thing.
298 - Title::newFromText( 'Greg' ),
 297+ Title::newFromText( $record[0]->page_title ),
299298 wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ),
300299 array(),
301300 array(
@@ -363,19 +362,9 @@
364363 . Html::closeElement( 'ul' )
365364 . Html::closeElement( 'div' );
366365
367 - # Only set a wrapper class for bucket 1.
368 - $class = '';
369 - if( array_key_exists( 'found', $record ) ) {
370 - if ( $record['found']->aa_response_boolean ) {
371 - $class = 'positive';
372 - } else {
373 - $class = 'negative';
374 - }
375 - }
376 -
377366 return Html::openElement( 'div', array( 'class' => 'articleFeedbackv5-feedback' ) )
378367 . Html::openElement( 'div', array(
379 - 'class' => "articleFeedbackv5-comment-wrap $class"
 368+ 'class' => "articleFeedbackv5-comment-wrap"
380369 ) )
381370 . $content
382371 . $footer_links
@@ -416,8 +405,6 @@
417406 . '</blockquote>';
418407 }
419408
420 - # TODO: The headers here really need the same treatment as bucket1, with
421 - # the links and such.
422409 private function renderBucket3( $record ) {
423410 $name = htmlspecialchars( $record[0]->user_name );
424411 $rating = htmlspecialchars( $record['rating']->aa_response_rating );
@@ -488,18 +475,19 @@
489476
490477 private function feedbackHead( $message, $class, $record, $extra = '' ) {
491478 $gender = ''; #?
492 - $name = htmlspecialchars( $record->user_name );
493 - $link = $record->af_user_id ? "User:$name" : "Special:Contributions/$name";
494 - $html = Html::openElement( 'h3' )
 479+ $name = htmlspecialchars( $record->user_name );
 480+ $link = $record->af_user_id ? "User:$name" : "Special:Contributions/$name";
 481+
 482+ return Html::openElement( 'h3', array(
 483+ 'class' => $class
 484+ ) )
495485 . Html::element( 'span', array( 'class' => 'icon' ) )
496486 . Linker::link( Title::newFromText( $link ), $name )
497487 . Html::element( 'span',
498 - array( 'class' => $class ),
 488+ array( 'class' => 'result' ),
499489 wfMessage( $message, $gender, $extra )->escaped()
500490 )
501491 . Html::closeElement( 'h3' );
502 -
503 - return $html;
504492 }
505493
506494 /**

Follow-up revisions

RevisionCommit summaryAuthorDate
r110405AFT5 - Fix the way article diff links are built, to work in non-default names...gregchiasson16:43, 31 January 2012

Comments

#Comment by Catrope (talk | contribs)   06:23, 31 January 2012
+			Title::newFromText( $record[0]->page_title ),

This doesn't work for titles outside of the main namespace. You need to select page_namespace too, then useTitle::newFromRow( $record[0] ) .

OK otherwise.

Status & tagging log