r41626 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41625‎ | r41626 | r41627 >
Date:23:48, 3 October 2008
Author:aaron
Status:old (Comments)
Tags:todo 
Comment:
* Whip up quick tag removal for now
* Add duplicate convenience submit button
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.i18n.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionTagger.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionView.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/CodeReview.i18n.php
@@ -36,7 +36,8 @@
3737 'code-rev-status' => 'Status:',
3838 'code-rev-status-set' => 'Change status',
3939 '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:',
4142 'code-rev-comment-by' => 'Comment by $1',
4243 'code-rev-comment-submit' => 'Submit comment',
4344 'code-rev-comment-preview' => 'Preview',
Index: trunk/extensions/CodeReview/CodeRevisionTagger.php
@@ -6,18 +6,18 @@
77 parent::__construct( $repoName, $rev );
88
99 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' ) );
1112 }
1213
1314 function execute() {
1415 global $wgOut;
1516
1617 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 );
2222 }
2323 }
2424
@@ -35,6 +35,6 @@
3636
3737 function validPost( $permission ) {
3838 return parent::validPost( $permission ) &&
39 - !empty( $this->mTags );
 39+ ( !empty( $this->mTags ) || !empty( $this->mRemoveTags ) );
4040 }
4141 }
Index: trunk/extensions/CodeReview/CodeRevisionView.php
@@ -47,9 +47,14 @@
4848 'code-rev-paths' => $paths,
4949 'code-rev-tags' => $this->tagForm(),
5050 );
 51+ $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/'.$this->mRev->getId() );
5152
52 - $special = SpecialPage::getTitleFor( 'Code', $this->mRepo->getName().'/'.$this->mRev->getId() );
5353 $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>';
5459 $html .= '<table class="mw-codereview-meta">';
5560 foreach( $fields as $label => $data ) {
5661 $html .= "<tr><td>" . wfMsgHtml( $label ) . "</td><td>$data</td></tr>\n";
@@ -182,8 +187,7 @@
183188 $rev = $this->mRev->getId();
184189 $special = SpecialPage::getTitleFor( 'Code', "$repo/$rev/set/status" );
185190 return
186 - Xml::openElement( 'select',
187 - array( 'name' => 'wpStatus' ) ) .
 191+ Xml::openElement( 'select', array( 'name' => 'wpStatus' ) ) .
188192 $this->buildStatusList() .
189193 '</select>';
190194 } else {
@@ -208,8 +212,11 @@
209213 global $wgUser;
210214 $repo = $this->mRepo->getName();
211215 $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>&nbsp;</td><td>' .
 219+ Xml::inputLabel( wfMsg('code-rev-tag-remove'), 'wpRemoveTag', 'wpRemoveTag', '' ) .
 220+ '</td></tr></table></div>';
214221 }
215222
216223 function formatTag( $tag ) {

Comments

#Comment by Brion VIBBER (talk | contribs)   23:56, 3 October 2008

Remove interface is a little funky, but it'll get the job done for now :D

Status & tagging log