r96322 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r96321‎ | r96322 | r96323 >
Date:11:50, 6 September 2011
Author:reedy
Status:ok
Tags:
Comment:
* (bug 29724) The header with "User" "Flag" and "Date" shouldn't be displayed if the table is empty
Modified paths:
  • /trunk/extensions/CodeReview/ui/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/ui/CodeRevisionView.php
@@ -573,17 +573,21 @@
574574 */
575575 protected function formatSignoffs( $signOffs, $showButtons ) {
576576 $this->showButtonsFormatSignoffs = $showButtons;
577 - $signoffs = implode( "\n",
578 - array_map( array( $this, 'formatSignoffInline' ), $signOffs )
579 - );
580577
581578 $header = '';
582 - if ( $showButtons ) {
583 - $header = '<th></th>';
 579+ if ( count( $signOffs ) ) {
 580+ if ( $showButtons ) {
 581+ $header = '<th></th>';
 582+ }
 583+ $signoffs = implode( "\n",
 584+ array_map( array( $this, 'formatSignoffInline' ), $signOffs )
 585+ );
 586+ $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>';
 587+ $header .= '<th>' . wfMsgHtml( 'code-signoff-field-flag' ). '</th>';
 588+ $header .= '<th>' . wfMsgHtml( 'code-signoff-field-date' ). '</th>';
 589+ } else {
 590+ $signoffs = '';
584591 }
585 - $header .= '<th>' . wfMsgHtml( 'code-signoff-field-user' ) . '</th>';
586 - $header .= '<th>' . wfMsgHtml( 'code-signoff-field-flag' ). '</th>';
587 - $header .= '<th>' . wfMsgHtml( 'code-signoff-field-date' ). '</th>';
588592 $buttonrow = $showButtons ? $this->signoffButtons( $signOffs ) : '';
589593 return "<table border='1' class='wikitable'><tr>$header</tr>$signoffs$buttonrow</table>";
590594 }

Status & tagging log