Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewFeedbackArticleFeedbackv5.php |
— | — | @@ -293,6 +293,7 @@ |
294 | 294 | 'class' => 'articleFeedbackv5-comment-details-updates' |
295 | 295 | ) ) |
296 | 296 | . Linker::link( |
| 297 | +#TODO: take out that hardcoded thing. |
297 | 298 | Title::newFromText( 'Greg' ), |
298 | 299 | wfMessage( 'articlefeedbackv5-updates-since', $record[0]->age ), |
299 | 300 | array(), |
— | — | @@ -362,9 +363,19 @@ |
363 | 364 | . Html::closeElement( 'ul' ) |
364 | 365 | . Html::closeElement( 'div' ); |
365 | 366 | |
| 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 | + |
366 | 377 | return Html::openElement( 'div', array( 'class' => 'articleFeedbackv5-feedback' ) ) |
367 | 378 | . Html::openElement( 'div', array( |
368 | | - 'class' => 'articleFeedbackv5-comment-wrap' |
| 379 | + 'class' => "articleFeedbackv5-comment-wrap $class" |
369 | 380 | ) ) |
370 | 381 | . $content |
371 | 382 | . $footer_links |
— | — | @@ -376,7 +387,9 @@ |
377 | 388 | } |
378 | 389 | |
379 | 390 | private function renderBucket1( $record ) { |
380 | | - $name = htmlspecialchars( $record[0]->user_name ); |
| 391 | + $name = htmlspecialchars( $record[0]->user_name ); |
| 392 | + $link = $record[0]->af_user_id ? "User:$name" : "Special:Contributions/$name"; |
| 393 | + |
381 | 394 | if ( $record['found']->aa_response_boolean ) { |
382 | 395 | $msg = 'articlefeedbackv5-form1-header-found'; |
383 | 396 | $class = 'positive'; |
— | — | @@ -385,9 +398,8 @@ |
386 | 399 | $class = 'negative'; |
387 | 400 | } |
388 | 401 | $found = Html::openElement( 'h3' ) |
389 | | - . Html::element( 'a', array( |
390 | | - 'href' => '#', |
391 | | - ), $name ) |
| 402 | + . Html::element( 'span', array( 'class' => 'icon' ) ) |
| 403 | + . Linker::link( Title::newFromText( $link ), $name ) |
392 | 404 | .Html::element( 'span', array( |
393 | 405 | 'class' => $class, |
394 | 406 | ), wfMessage( $msg, '')->escaped() ) |
— | — | @@ -406,15 +418,23 @@ |
407 | 419 | // * articlefeedbackv5-form2-header-problem |
408 | 420 | // * articlefeedbackv5-form2-header-question |
409 | 421 | // * articlefeedbackv5-form2-header-suggestion |
410 | | - return wfMessage( 'articlefeedbackv5-form2-header-' . $type, $name )->escaped() |
| 422 | + return |
| 423 | + Html::openElement( 'h3' ) |
| 424 | + . wfMessage( 'articlefeedbackv5-form2-header-' . $type, $name )->escaped() |
| 425 | + . Html::closeElement( 'h3' ) |
411 | 426 | . '<blockquote>' . htmlspecialchars( $record['comment']->aa_response_text ) |
412 | 427 | . '</blockquote>'; |
413 | 428 | } |
414 | 429 | |
| 430 | + # TODO: The headers here really need the same treatment as bucket1, with |
| 431 | + # the links and such. |
415 | 432 | private function renderBucket3( $record ) { |
416 | 433 | $name = htmlspecialchars( $record[0]->user_name ); |
417 | 434 | $rating = htmlspecialchars( $record['rating']->aa_response_rating ); |
418 | | - return wfMessage( 'articlefeedbackv5-form3-header', $name, $rating )->escaped() |
| 435 | + return |
| 436 | + Html::openElement( 'h3' ) |
| 437 | + . wfMessage( 'articlefeedbackv5-form3-header', $name, $rating )->escaped() |
| 438 | + . Html::closeElement( 'h3' ) |
419 | 439 | . '<blockquote>' . htmlspecialchars( $record['comment']->aa_response_text ) |
420 | 440 | . '</blockquote>'; |
421 | 441 | } |
— | — | @@ -425,7 +445,10 @@ |
426 | 446 | |
427 | 447 | private function renderBucket5( $record ) { |
428 | 448 | $name = htmlspecialchars( $record[0]->user_name ); |
429 | | - $rv = wfMessage( 'articlefeedbackv5-form5-header', $name )->escaped(); |
| 449 | + $rv = |
| 450 | + Html::openElement( 'h3' ) |
| 451 | + . wfMessage( 'articlefeedbackv5-form5-header', $name )->escaped() |
| 452 | + . Html::closeElement( 'h3' ); |
430 | 453 | $rv .= '<ul>'; |
431 | 454 | foreach ( $record as $key => $answer ) { |
432 | 455 | if ( $answer->afi_data_type == 'rating' && $key != '0' ) { |