Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | 'code-author-unlinksuccess' => 'Author $1 has been unlinked', |
46 | 46 | 'code-author-badtoken' => 'Session error trying to perform the action.', |
47 | 47 | 'code-author-total' => 'Total number of authors: $1', |
| 48 | + 'code-author-lastcommit' => 'Last commit date', |
48 | 49 | 'code-browsing-path' => "Browsing revisions in '''$1'''", |
49 | 50 | 'code-field-id' => 'Revision', |
50 | 51 | 'code-field-author' => 'Author', |
Index: trunk/extensions/CodeReview/backend/CodeRepository.php |
— | — | @@ -113,20 +113,22 @@ |
114 | 114 | $dbr = wfGetDB( DB_SLAVE ); |
115 | 115 | $res = $dbr->select( |
116 | 116 | 'code_rev', |
117 | | - array( 'cr_author' ), |
| 117 | + array( 'cr_author', 'MAX(cr_timestamp) AS time' ), |
118 | 118 | array( 'cr_repo_id' => $this->getId() ), |
119 | 119 | __METHOD__, |
120 | 120 | array( 'GROUP BY' => 'cr_author', |
121 | 121 | 'ORDER BY' => 'cr_author', 'LIMIT' => 500 ) |
122 | 122 | ); |
123 | 123 | $authors = array(); |
124 | | - while ( $row = $dbr->fetchObject( $res ) ) { |
125 | | - $authors[] = $row->cr_author; |
| 124 | + foreach( $res as $row ) { |
| 125 | + if ( $row->cr_author !== null ) { |
| 126 | + $authors[] = array( 'author' => $row->cr_author, 'lastcommit' => $row->time ); |
| 127 | + } |
126 | 128 | } |
127 | 129 | $wgMemc->set( $key, $authors, 3600 * 24 ); |
128 | 130 | return $authors; |
129 | 131 | } |
130 | | - |
| 132 | + |
131 | 133 | public function getAuthorCount() { |
132 | 134 | return count( $this->getAuthorList() ); |
133 | 135 | } |
Index: trunk/extensions/CodeReview/ui/CodeCommentsListView.php |
— | — | @@ -36,7 +36,9 @@ |
37 | 37 | return $field == 'cr_timestamp'; |
38 | 38 | } |
39 | 39 | |
40 | | - function getDefaultSort() { return 'cc_timestamp'; } |
| 40 | + function getDefaultSort() { |
| 41 | + return 'cc_timestamp'; |
| 42 | + } |
41 | 43 | |
42 | 44 | function getQueryInfo() { |
43 | 45 | return array( |
Index: trunk/extensions/CodeReview/ui/CodeAuthorListView.php |
— | — | @@ -13,18 +13,30 @@ |
14 | 14 | $repo = $this->mRepo->getName(); |
15 | 15 | $text = wfMsg( 'code-authors-text' ) . "\n\n"; |
16 | 16 | $text .= '<strong>' . wfMsg( 'code-author-total', $wgLang->formatNum( $this->mRepo->getAuthorCount() ) ) . "</strong>\n"; |
| 17 | + |
| 18 | + $wgOut->addWikiText( $text ); |
| 19 | + |
| 20 | + $wgOut->addHTML( '<table class="TablePager">' |
| 21 | + . '<tr><th>' . wfMsgHtml( 'code-field-author' ) |
| 22 | + . '</th><th>' . wfMsgHtml( 'code-author-lastcommit' ) . '</th></tr>' ); |
| 23 | + |
17 | 24 | foreach ( $authors as $committer ) { |
18 | 25 | if ( $committer ) { |
19 | | - $text .= "* [[Special:Code/$repo/author/$committer|$committer]]"; |
20 | | - $user = $this->mRepo->authorWikiUser( $committer ); |
| 26 | + $wgOut->addHTML( "<tr><td>" ); |
| 27 | + $author = $committer["author"]; |
| 28 | + $text = "[[Special:Code/$repo/author/$committer|$author]]"; |
| 29 | + $user = $this->mRepo->authorWikiUser( $author ); |
21 | 30 | if ( $user ) { |
22 | 31 | $title = htmlspecialchars( $user->getUserPage()->getPrefixedText() ); |
23 | 32 | $name = htmlspecialchars( $user->getName() ); |
24 | 33 | $text .= " ([[$title|$name]])"; |
25 | 34 | } |
26 | | - $text .= "\n"; |
| 35 | + $wgOut->addWikiText( $text ); |
| 36 | + |
| 37 | + $wgOut->addHTML( "</td><td>{$wgLang->timeanddate( $committer["lastcommit"], true )}</td></tr>" ); |
27 | 38 | } |
28 | 39 | } |
29 | | - $wgOut->addWikiText( $text ); |
| 40 | + |
| 41 | + $wgOut->addHTML( '</table>' ); |
30 | 42 | } |
31 | | -} |
| 43 | +} |
\ No newline at end of file |