Index: trunk/extensions/CodeReview/CodeReview.i18n.php |
— | — | @@ -36,7 +36,8 @@ |
37 | 37 | 'code-rev-status' => 'Status:', |
38 | 38 | 'code-rev-status-set' => 'Change status', |
39 | 39 | 'code-rev-tags' => 'Tags:', |
40 | | - 'code-rev-tag-add' => 'Add tag', |
| 40 | + 'code-rev-tag-add' => 'Add tags:', |
| 41 | + 'code-rev-tag-remove' => 'Remove tags:', |
41 | 42 | 'code-rev-comment-by' => 'Comment by $1', |
42 | 43 | 'code-rev-comment-submit' => 'Submit comment', |
43 | 44 | 'code-rev-comment-preview' => 'Preview', |
Index: trunk/extensions/CodeReview/CodeRevisionTagger.php |
— | — | @@ -6,18 +6,18 @@ |
7 | 7 | parent::__construct( $repoName, $rev ); |
8 | 8 | |
9 | 9 | global $wgRequest; |
10 | | - $this->mTags = $this->splitTags( $wgRequest->getText( 'wpTag' ) ); |
| 10 | + $this->mAddTags = $this->splitTags( $wgRequest->getText( 'wpTag' ) ); |
| 11 | + $this->mRemoveTags = $this->splitTags( $wgRequest->getText( 'wpRemoveTag' ) ); |
11 | 12 | } |
12 | 13 | |
13 | 14 | function execute() { |
14 | 15 | global $wgOut; |
15 | 16 | |
16 | 17 | if( $this->validPost( 'codereview-add-tag' ) ) { |
17 | | - $this->mRev->addTags( $this->mTags ); |
18 | | - |
19 | | - $repo = $this->mRepo->getName(); |
20 | | - $rev = $this->mRev->getId(); |
21 | | - $special = SpecialPage::getTitleFor( 'Code', "$repo/$rev" ); |
| 18 | + if( count($this->mAddTags) ) |
| 19 | + $this->mRev->addTags( $this->mAddTags ); |
| 20 | + if( count($this->mRemoveTags) ) |
| 21 | + $this->mRev->removeTags( $this->mRemoveTags ); |
22 | 22 | } |
23 | 23 | } |
24 | 24 | |
— | — | @@ -35,6 +35,6 @@ |
36 | 36 | |
37 | 37 | function validPost( $permission ) { |
38 | 38 | return parent::validPost( $permission ) && |
39 | | - !empty( $this->mTags ); |
| 39 | + ( !empty( $this->mTags ) || !empty( $this->mRemoveTags ) ); |
40 | 40 | } |
41 | 41 | } |
Index: trunk/extensions/CodeReview/CodeRevisionView.php |
— | — | @@ -47,9 +47,14 @@ |
48 | 48 | 'code-rev-paths' => $paths, |
49 | 49 | 'code-rev-tags' => $this->tagForm(), |
50 | 50 | ); |
| 51 | + $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/'.$this->mRev->getId() ); |
51 | 52 | |
52 | | - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/'.$this->mRev->getId() ); |
53 | 53 | $html = Xml::openElement( 'form', array( 'action' => $special->getLocalUrl(), 'method' => 'post' ) ); |
| 54 | + $html .= '<div>' . |
| 55 | + Xml::submitButton( wfMsg( 'code-rev-submit' ), array( 'name' => 'wpSave' ) ) . |
| 56 | + ' ' . |
| 57 | + Xml::submitButton( wfMsg( 'code-rev-comment-preview' ), array( 'name' => 'wpPreview' ) ) . |
| 58 | + '</div>'; |
54 | 59 | $html .= '<table class="mw-codereview-meta">'; |
55 | 60 | foreach( $fields as $label => $data ) { |
56 | 61 | $html .= "<tr><td>" . wfMsgHtml( $label ) . "</td><td>$data</td></tr>\n"; |
— | — | @@ -182,8 +187,7 @@ |
183 | 188 | $rev = $this->mRev->getId(); |
184 | 189 | $special = SpecialPage::getTitleFor( 'Code', "$repo/$rev/set/status" ); |
185 | 190 | return |
186 | | - Xml::openElement( 'select', |
187 | | - array( 'name' => 'wpStatus' ) ) . |
| 191 | + Xml::openElement( 'select', array( 'name' => 'wpStatus' ) ) . |
188 | 192 | $this->buildStatusList() . |
189 | 193 | '</select>'; |
190 | 194 | } else { |
— | — | @@ -208,8 +212,11 @@ |
209 | 213 | global $wgUser; |
210 | 214 | $repo = $this->mRepo->getName(); |
211 | 215 | $rev = $this->mRev->getId(); |
212 | | - $special = SpecialPage::getTitleFor( 'Code', "$repo/$rev/add/tag" ); |
213 | | - return Xml::input( 'wpTag', '' ); |
| 216 | + return '<div><table><tr><td>' . |
| 217 | + Xml::inputLabel( wfMsg('code-rev-tag-add'), 'wpTag', 'wpTag', '' ) . |
| 218 | + '</td><td> </td><td>' . |
| 219 | + Xml::inputLabel( wfMsg('code-rev-tag-remove'), 'wpRemoveTag', 'wpRemoveTag', '' ) . |
| 220 | + '</td></tr></table></div>'; |
214 | 221 | } |
215 | 222 | |
216 | 223 | function formatTag( $tag ) { |