r41575 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41574‎ | r41575 | r41576 >
Date:23:17, 2 October 2008
Author:aaron
Status:old (Comments)
Tags:
Comment:
Add comment count to pager
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionListView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -18,6 +18,7 @@
1919 'code-field-message' => 'Comment',
2020 'code-field-status' => 'Status',
2121 'code-field-timestamp' => 'Date',
 22+ 'code-field-comments' => 'Notes',
2223 'code-rev-author' => 'Author:',
2324 'code-rev-message' => 'Comment:',
2425 'code-rev-repo' => 'Repository:',
Index: trunk/extensions/CodeReview/CodeRevisionListView.php
@@ -46,9 +46,13 @@
4747
4848 function getQueryInfo(){
4949 return array(
50 - 'tables' => array( 'code_rev' ),
 50+ 'tables' => array( 'code_rev', 'code_comment' ),
5151 'fields' => array_keys( $this->getFieldNames() ),
5252 'conds' => array( 'cr_repo_id' => $this->mRepo->getId() ),
 53+ 'options' => array( 'GROUP BY' => 'cr_id' ),
 54+ 'join_conds' => array(
 55+ 'code_comment' => array( 'LEFT JOIN', 'cc_repo_id = cr_repo_id AND cc_rev_id = cr_id' )
 56+ )
5357 );
5458 }
5559
@@ -59,6 +63,7 @@
6064 'cr_message' => wfMsg( 'code-field-message' ),
6165 'cr_author' => wfMsg( 'code-field-author' ),
6266 'cr_timestamp' => wfMsg( 'code-field-timestamp' ),
 67+ 'COUNT(cc_rev_id)' => wfMsg( 'code-field-comments' ),
6368 );
6469 }
6570
@@ -81,6 +86,8 @@
8287 case 'cr_timestamp':
8388 global $wgLang;
8489 return $wgLang->timeanddate( $value );
 90+ case 'COUNT(cc_rev_id)':
 91+ return intval( $value );
8592 }
8693 }
8794
@@ -89,7 +96,7 @@
9097 return str_replace(
9198 '<tr>',
9299 Xml::openElement( 'tr',
93 - array( 'class' => "mw-codereview-status-$row->cr_status" ) ),
 100+ array( 'class' => "mw-codereview-status-{$row->cr_status}" ) ),
94101 parent::formatRow( $row ) );
95102 }
96103

Comments

#Comment by Brion VIBBER (talk | contribs)   23:35, 2 October 2008

I've bumped the column over to the left in r41577.

Would be nice if we can cleanly style it, though, to right- or center-align the #s.

Status & tagging log