Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -75,6 +75,8 @@ |
76 | 76 | 'code-rev-submit' => 'Save changes', |
77 | 77 | 'code-rev-submit-next' => 'Save & next unresolved', |
78 | 78 | |
| 79 | + 'codereview-subtitle' => 'For $1', |
| 80 | + |
79 | 81 | 'codereview-reply-link' => 'reply', |
80 | 82 | |
81 | 83 | 'codereview-email-subj' => '[$1] [r$2]: New comment added', |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -78,6 +78,15 @@ |
79 | 79 | } |
80 | 80 | } |
81 | 81 | $view->execute(); |
| 82 | + |
| 83 | + // Add subtitle for easy navigation |
| 84 | + global $wgOut; |
| 85 | + if ( $view instanceof CodeView ) { |
| 86 | + $repo = $view->getRepo(); |
| 87 | + if ( $repo ) |
| 88 | + $wgOut->setSubtitle( wfMsgExt( 'codereview-subtitle', 'parse', |
| 89 | + CodeRepoListView::getNavItem( $repo->getName() ) ) ); |
| 90 | + } |
82 | 91 | } |
83 | 92 | } |
84 | 93 | |
— | — | @@ -144,6 +153,12 @@ |
145 | 154 | } |
146 | 155 | return $html . "</table>\n"; |
147 | 156 | } |
| 157 | + |
| 158 | + function getRepo() { |
| 159 | + if ( $this->mRepo ) |
| 160 | + return $this->mRepo; |
| 161 | + return false; |
| 162 | + } |
148 | 163 | } |
149 | 164 | |
150 | 165 | class CodeCommentLinker { |
Index: trunk/extensions/CodeReview/CodeRepoListView.php |
— | — | @@ -13,13 +13,18 @@ |
14 | 14 | $text = ''; |
15 | 15 | foreach( $repos as $repo ){ |
16 | 16 | $name = $repo->getName(); |
17 | | - $text .= "* '''[[Special:Code/$name|$name]]''' ("; |
18 | | - $text .= "[[Special:Code/$name/comments|".wfMsgHtml( 'code-notes' )."]]"; |
19 | | - $text .= " | [[Special:Code/$name/tag|".wfMsgHtml( 'code-tags' )."]]"; |
20 | | - $text .= " | [[Special:Code/$name/author|".wfMsgHtml( 'code-authors' )."]]"; |
21 | | - $text .= ")\n"; |
| 17 | + $text .= "* ".self::getNavItem( $name )."\n"; |
22 | 18 | } |
23 | 19 | $wgOut->addWikiText( $text ); |
24 | 20 | } |
| 21 | + |
| 22 | + public static function getNavItem( $name ) { |
| 23 | + $text = "'''[[Special:Code/$name|$name]]''' ("; |
| 24 | + $text .= "[[Special:Code/$name/comments|".wfMsgHtml( 'code-notes' )."]]"; |
| 25 | + $text .= " | [[Special:Code/$name/tag|".wfMsgHtml( 'code-tags' )."]]"; |
| 26 | + $text .= " | [[Special:Code/$name/author|".wfMsgHtml( 'code-authors' )."]]"; |
| 27 | + $text .= ")"; |
| 28 | + return $text; |
| 29 | + } |
25 | 30 | } |
26 | 31 | |