Index: trunk/extensions/CodeReview/CodeRevisionAuthorListView.php |
— | — | @@ -1,22 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -// Special:Code/MediaWiki/author |
5 | | -class CodeRevisionAuthorListView extends CodeView { |
6 | | - function __construct( $repoName ) { |
7 | | - parent::__construct(); |
8 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
9 | | - } |
10 | | - |
11 | | - function execute() { |
12 | | - global $wgOut; |
13 | | - $authors = $this->mRepo->getAuthorList(); |
14 | | - $name = $this->mRepo->getName(); |
15 | | - $text = ''; |
16 | | - foreach( $authors as $user ) { |
17 | | - if( $user ) |
18 | | - $text .= "* [[Special:Code/$name/author/$user|$user]]\n"; |
19 | | - } |
20 | | - $wgOut->addWikiText( $text ); |
21 | | - } |
22 | | -} |
23 | | - |
Index: trunk/extensions/CodeReview/CodeRevisionTagListView.php |
— | — | @@ -1,21 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -// Special:Code/MediaWiki/tag |
5 | | -class CodeRevisionTagListView extends CodeView { |
6 | | - function __construct( $repoName ) { |
7 | | - parent::__construct(); |
8 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
9 | | - } |
10 | | - |
11 | | - function execute() { |
12 | | - global $wgOut; |
13 | | - $tags = $this->mRepo->getTagList(); |
14 | | - $name = $this->mRepo->getName(); |
15 | | - $text = ''; |
16 | | - foreach( $tags as $tag ) { |
17 | | - $text .= "* [[Special:Code/$name/tag/$tag|$tag]]\n"; |
18 | | - } |
19 | | - $wgOut->addWikiText( $text ); |
20 | | - } |
21 | | -} |
22 | | - |
Index: trunk/extensions/CodeReview/CodeRevisionStatusListView.php |
— | — | @@ -1,21 +0,0 @@ |
2 | | -<?php |
3 | | - |
4 | | -// Special:Code/MediaWiki/status |
5 | | -class CodeRevisionStatusListView extends CodeView { |
6 | | - function __construct( $repoName ) { |
7 | | - parent::__construct(); |
8 | | - $this->mRepo = CodeRepository::newFromName( $repoName ); |
9 | | - } |
10 | | - |
11 | | - function execute() { |
12 | | - global $wgOut; |
13 | | - $name = $this->mRepo->getName(); |
14 | | - $states = CodeRevision::getPossibleStates(); |
15 | | - $text = ''; |
16 | | - foreach( $states as $state ) { |
17 | | - $text .= "* [[Special:Code/$name/status/$state|$state]]\n"; |
18 | | - } |
19 | | - $wgOut->addWikiText( $text ); |
20 | | - } |
21 | | -} |
22 | | - |
Index: trunk/extensions/CodeReview/CodeReview.php |
— | — | @@ -51,9 +51,10 @@ |
52 | 52 | $wgAutoloadClasses['CodeRevisionTagger'] = $dir . 'CodeRevisionTagger.php'; |
53 | 53 | $wgAutoloadClasses['CodeRevisionTagView'] = $dir . 'CodeRevisionTagView.php'; |
54 | 54 | $wgAutoloadClasses['CodeRevisionView'] = $dir . 'CodeRevisionView.php'; |
55 | | -$wgAutoloadClasses['CodeRevisionAuthorListView'] = $dir . 'CodeRevisionAuthorListView.php'; |
56 | | -$wgAutoloadClasses['CodeRevisionStatusListView'] = $dir . 'CodeRevisionStatusListView.php'; |
57 | | -$wgAutoloadClasses['CodeRevisionTagListView'] = $dir . 'CodeRevisionTagListView.php'; |
| 55 | +$wgAutoloadClasses['CodeAuthorListView'] = $dir . 'CodeAuthorListView.php'; |
| 56 | +$wgAutoloadClasses['CodeStatusListView'] = $dir . 'CodeStatusListView.php'; |
| 57 | +$wgAutoloadClasses['CodeTagListView'] = $dir . 'CodeTagListView.php'; |
| 58 | +$wgAutoloadClasses['CodeCommentsListView'] = $dir . 'CodeCommentsListView.php'; |
58 | 59 | $wgAutoloadClasses['CodeComment'] = $dir . 'CodeComment.php'; |
59 | 60 | $wgAutoloadClasses['SpecialCode'] = $dir . 'SpecialCode.php'; |
60 | 61 | $wgAutoloadClasses['CodeView'] = $dir . 'SpecialCode.php'; |
— | — | @@ -61,7 +62,9 @@ |
62 | 63 | $wgAutoloadClasses['SubversionAdaptor'] = $dir . 'Subversion.php'; |
63 | 64 | |
64 | 65 | $wgSpecialPages['Code'] = 'SpecialCode'; |
| 66 | +$wgSpecialPageGroups['Code'] = 'developer'; |
65 | 67 | $wgSpecialPages['RepoAdmin'] = 'SpecialRepoAdmin'; |
| 68 | +$wgSpecialPageGroups['RepoAdmin'] = 'developer'; |
66 | 69 | |
67 | 70 | $wgAPIModules['codeupdate'] = 'ApiCodeUpdate'; |
68 | 71 | |
Index: trunk/extensions/CodeReview/CodeTagListView.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// Special:Code/MediaWiki/tag |
| 5 | +class CodeTagListView extends CodeView { |
| 6 | + function __construct( $repoName ) { |
| 7 | + parent::__construct(); |
| 8 | + $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 9 | + } |
| 10 | + |
| 11 | + function execute() { |
| 12 | + global $wgOut; |
| 13 | + $tags = $this->mRepo->getTagList(); |
| 14 | + $name = $this->mRepo->getName(); |
| 15 | + $text = ''; |
| 16 | + foreach( $tags as $tag ) { |
| 17 | + $text .= "* [[Special:Code/$name/tag/$tag|$tag]]\n"; |
| 18 | + } |
| 19 | + $wgOut->addWikiText( $text ); |
| 20 | + } |
| 21 | +} |
| 22 | + |
Property changes on: trunk/extensions/CodeReview/CodeTagListView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 23 | + native |
Index: trunk/extensions/CodeReview/CodeStatusListView.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// Special:Code/MediaWiki/status |
| 5 | +class CodeStatusListView extends CodeView { |
| 6 | + function __construct( $repoName ) { |
| 7 | + parent::__construct(); |
| 8 | + $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 9 | + } |
| 10 | + |
| 11 | + function execute() { |
| 12 | + global $wgOut; |
| 13 | + $name = $this->mRepo->getName(); |
| 14 | + $states = CodeRevision::getPossibleStates(); |
| 15 | + $text = ''; |
| 16 | + foreach( $states as $state ) { |
| 17 | + $text .= "* [[Special:Code/$name/status/$state|$state]]\n"; |
| 18 | + } |
| 19 | + $wgOut->addWikiText( $text ); |
| 20 | + } |
| 21 | +} |
| 22 | + |
Property changes on: trunk/extensions/CodeReview/CodeStatusListView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 23 | + native |
Index: trunk/extensions/CodeReview/CodeCommentsListView.php |
— | — | @@ -0,0 +1,114 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// Special:Code/MediaWiki |
| 5 | +class CodeCommentsListView extends CodeView { |
| 6 | + function __construct( $repoName ) { |
| 7 | + parent::__construct(); |
| 8 | + $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 9 | + } |
| 10 | + |
| 11 | + function execute() { |
| 12 | + global $wgOut; |
| 13 | + $pager = $this->getPager(); |
| 14 | + $wgOut->addHtml( |
| 15 | + $pager->getNavigationBar() . |
| 16 | + $pager->getLimitForm() . |
| 17 | + $pager->getBody() . |
| 18 | + $pager->getNavigationBar() |
| 19 | + ); |
| 20 | + } |
| 21 | + |
| 22 | + function getPager() { |
| 23 | + return new CodeCommentsTablePager( $this ); |
| 24 | + } |
| 25 | +} |
| 26 | + |
| 27 | +// Pager for CodeRevisionListView |
| 28 | +class CodeCommentsTablePager extends TablePager { |
| 29 | + |
| 30 | + function __construct( CodeCommentsListView $view ){ |
| 31 | + global $IP; |
| 32 | + $this->mView = $view; |
| 33 | + $this->mRepo = $view->mRepo; |
| 34 | + $this->mDefaultDirection = true; |
| 35 | + $this->mCurSVN = SpecialVersion::getSvnRevision( $IP ); |
| 36 | + parent::__construct(); |
| 37 | + } |
| 38 | + |
| 39 | + function isFieldSortable( $field ){ |
| 40 | + return $field == 'cr_timestamp'; |
| 41 | + } |
| 42 | + |
| 43 | + function getDefaultSort(){ return 'cc_timestamp'; } |
| 44 | + |
| 45 | + function getQueryInfo(){ |
| 46 | + return array( |
| 47 | + 'tables' => array( 'code_comment', 'code_rev' ), |
| 48 | + 'fields' => array_keys( $this->getFieldNames() ), |
| 49 | + 'conds' => array( 'cc_repo_id' => $this->mRepo->getId() ), |
| 50 | + 'join_conds' => array( |
| 51 | + 'code_rev' => array( 'LEFT JOIN', 'cc_repo_id = cr_repo_id AND cc_rev_id = cr_id' ) |
| 52 | + ) |
| 53 | + ); |
| 54 | + } |
| 55 | + |
| 56 | + function getFieldNames(){ |
| 57 | + return array( |
| 58 | + 'cc_timestamp' => wfMsg( 'code-field-timestamp' ), |
| 59 | + 'cc_user_text' => wfMsg( 'code-field-user' ), |
| 60 | + 'cc_rev_id' => wfMsg( 'code-field-id' ), |
| 61 | + 'cr_status' => wfMsg( 'code-field-status' ), |
| 62 | + 'cr_message' => wfMsg( 'code-field-message' ), |
| 63 | + 'cc_text' => wfMsg( 'code-field-text' ), |
| 64 | + ); |
| 65 | + } |
| 66 | + |
| 67 | + function formatValue( $name, $value ){ |
| 68 | + global $wgUser, $wgLang; |
| 69 | + switch( $name ){ |
| 70 | + case 'cc_rev_id': |
| 71 | + return $this->mView->mSkin->link( |
| 72 | + SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/' . $value ), |
| 73 | + htmlspecialchars( $value ) ); |
| 74 | + case 'cr_status': |
| 75 | + return $this->mView->mSkin->link( |
| 76 | + SpecialPage::getTitleFor( 'Code', |
| 77 | + $this->mRepo->getName() . '/status/' . $value ), |
| 78 | + htmlspecialchars( $this->mView->statusDesc( $value ) ) ); |
| 79 | + case 'cc_user_text': |
| 80 | + return $this->mView->mSkin->userLink( -1, $value ); |
| 81 | + case 'cr_message': |
| 82 | + return $this->mView->messageFragment( $value ); |
| 83 | + case 'cc_text': |
| 84 | + # Truncate this, blah blah... |
| 85 | + $text = htmlspecialchars($value); |
| 86 | + $preview = $wgLang->truncate( $text, 400 ); |
| 87 | + if( strlen($preview) < strlen($text) ) { |
| 88 | + $preview = substr( $preview, 0, strrpos($preview,' ') ); |
| 89 | + $preview .= " . . ."; |
| 90 | + } |
| 91 | + return $preview; |
| 92 | + case 'cc_timestamp': |
| 93 | + global $wgLang; |
| 94 | + return $wgLang->timeanddate( $value ); |
| 95 | + } |
| 96 | + } |
| 97 | + |
| 98 | + // Note: this function is poorly factored in the parent class |
| 99 | + function formatRow( $row ) { |
| 100 | + global $wgWikiSVN; |
| 101 | + $class = "mw-codereview-status-{$row->cr_status}"; |
| 102 | + if($this->mRepo->mName == $wgWikiSVN){ |
| 103 | + $class .= " mw-codereview-" . ( $row->cc_rev_id <= $this->mCurSVN ? 'live' : 'notlive' ); |
| 104 | + } |
| 105 | + return str_replace( |
| 106 | + '<tr>', |
| 107 | + Xml::openElement( 'tr', |
| 108 | + array( 'class' => $class ) ), |
| 109 | + parent::formatRow( $row ) ); |
| 110 | + } |
| 111 | + |
| 112 | + function getTitle(){ |
| 113 | + return SpecialPage::getTitleFor( 'Code', $this->mRepo->getName() . '/comments' ); |
| 114 | + } |
| 115 | +} |
Property changes on: trunk/extensions/CodeReview/CodeCommentsListView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 116 | + native |
Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -13,6 +13,10 @@ |
14 | 14 | 'code-comments' => 'Comments', |
15 | 15 | 'code-desc' => '[[Special:Code|Code review tool]] with [[Special:RepoAdmin|Subversion support]]', |
16 | 16 | 'code-no-repo' => 'No repository configured!', |
| 17 | + 'code-comments' => 'review notes', |
| 18 | + 'code-authors' => 'authors', |
| 19 | + 'code-tags' => 'tags', |
| 20 | + 'code-authors-text' => 'Below is a list of repo authors in order of recent commits.', |
17 | 21 | 'code-author-haslink' => 'This author is linked to the wiki user $1', |
18 | 22 | 'code-author-orphan' => 'This author has no link with a wiki account', |
19 | 23 | 'code-author-dolink' => 'Link this author to a wiki user:', |
— | — | @@ -25,10 +29,12 @@ |
26 | 30 | 'code-author-unlinksuccess' => 'Author $1 has been unlinked', |
27 | 31 | 'code-field-id' => 'Revision', |
28 | 32 | 'code-field-author' => 'Author', |
29 | | - 'code-field-message' => 'Comment', |
| 33 | + 'code-field-user' => 'Commentor', |
| 34 | + 'code-field-message' => 'Summary', |
30 | 35 | 'code-field-status' => 'Status', |
31 | 36 | 'code-field-timestamp' => 'Date', |
32 | 37 | 'code-field-comments' => 'Notes', |
| 38 | + 'code-field-text' => 'Note', |
33 | 39 | 'code-rev-author' => 'Author:', |
34 | 40 | 'code-rev-message' => 'Comment:', |
35 | 41 | 'code-rev-repo' => 'Repository:', |
— | — | @@ -73,6 +79,8 @@ |
74 | 80 | 'right-codereview-remove-tag' => 'Remove tags from revisions', |
75 | 81 | 'right-codereview-post-comment' => 'Add comments on revisions', |
76 | 82 | 'right-codereview-set-status' => 'Change revisions status', |
| 83 | + |
| 84 | + 'specialpages-group-developer' => 'Developer tools', |
77 | 85 | ); |
78 | 86 | |
79 | 87 | /** Arabic (العربية) |
Index: trunk/extensions/CodeReview/SpecialCode.php |
— | — | @@ -34,14 +34,17 @@ |
35 | 35 | $view = new CodeRevisionView( $params[0], $params[1] ); |
36 | 36 | break; |
37 | 37 | } else if( $params[1] === 'tag' ) { |
38 | | - $view = new CodeRevisionTagListView( $params[0] ); |
| 38 | + $view = new CodeTagListView( $params[0] ); |
39 | 39 | break; |
40 | 40 | } elseif( $params[1] === 'author' ) { |
41 | | - $view = new CodeRevisionAuthorListView( $params[0] ); |
| 41 | + $view = new CodeAuthorListView( $params[0] ); |
42 | 42 | break; |
43 | 43 | } elseif( $params[1] === 'status' ) { |
44 | | - $view = new CodeRevisionStatusListView( $params[0] ); |
| 44 | + $view = new CodeStatusListView( $params[0] ); |
45 | 45 | break; |
| 46 | + } elseif( $params[1] === 'comments' ) { |
| 47 | + $view = new CodeCommentsListView( $params[0] ); |
| 48 | + break; |
46 | 49 | } else { |
47 | 50 | $view = new CodeRevisionView( $params[0], $params[1] ); |
48 | 51 | break; |
Index: trunk/extensions/CodeReview/CodeAuthorListView.php |
— | — | @@ -0,0 +1,22 @@ |
| 2 | +<?php |
| 3 | + |
| 4 | +// Special:Code/MediaWiki/author |
| 5 | +class CodeAuthorListView extends CodeView { |
| 6 | + function __construct( $repoName ) { |
| 7 | + parent::__construct(); |
| 8 | + $this->mRepo = CodeRepository::newFromName( $repoName ); |
| 9 | + } |
| 10 | + |
| 11 | + function execute() { |
| 12 | + global $wgOut; |
| 13 | + $authors = $this->mRepo->getAuthorList(); |
| 14 | + $name = $this->mRepo->getName(); |
| 15 | + $text = wfMsg( 'code-authors-text' ) . "\n"; |
| 16 | + foreach( $authors as $user ) { |
| 17 | + if( $user ) |
| 18 | + $text .= "* [[Special:Code/$name/author/$user|$user]]\n"; |
| 19 | + } |
| 20 | + $wgOut->addWikiText( $text ); |
| 21 | + } |
| 22 | +} |
| 23 | + |
Property changes on: trunk/extensions/CodeReview/CodeAuthorListView.php |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 24 | + native |
Index: trunk/extensions/CodeReview/CodeRepoListView.php |
— | — | @@ -13,7 +13,11 @@ |
14 | 14 | $text = ''; |
15 | 15 | foreach( $repos as $repo ){ |
16 | 16 | $name = $repo->getName(); |
17 | | - $text .= "* [[Special:Code/$name|$name]]\n"; |
| 17 | + $text .= "* '''[[Special:Code/$name|$name]]''' ("; |
| 18 | + $text .= "[[Special:Code/$name/comments|".wfMsgHtml( 'code-comments' )."]]"; |
| 19 | + $text .= " | [[Special:Code/$name/tag|".wfMsgHtml( 'code-tags' )."]]"; |
| 20 | + $text .= " | [[Special:Code/$name/author|".wfMsgHtml( 'code-authors' )."]]"; |
| 21 | + $text .= ")\n"; |
18 | 22 | } |
19 | 23 | $wgOut->addWikiText( $text ); |
20 | 24 | } |