r55821 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r55820‎ | r55821 | r55822 >
Date:14:32, 4 September 2009
Author:raymond
Status:ok (Comments)
Tags:
Comment:
Make revdel input form more consistent with other forms:
* Use CSS classes for input and label elements for default form design
** Makes it RTL friendly too
* Add a "Edit delete reasons" link
Modified paths:
  • /trunk/phase3/includes/specials/SpecialRevisiondelete.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)
  • /trunk/phase3/maintenance/language/messages.inc (modified) (history)
  • /trunk/phase3/skins/common/common_rtl.css (modified) (history)
  • /trunk/phase3/skins/common/shared.css (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/language/messages.inc
@@ -713,6 +713,7 @@
714714 'revdelete-reason-dropdown',
715715 'revdelete-otherreason',
716716 'revdelete-reasonotherlist',
 717+ 'revdelete-edit-reasonlist',
717718 ),
718719 'suppression' => array(
719720 'suppressionlog',
Index: trunk/phase3/skins/common/common_rtl.css
@@ -30,7 +30,8 @@
3131 }
3232 /* Convenience links to edit block, delete and protect reasons */
3333 p.mw-ipb-conveniencelinks, p.mw-protect-editreasons,
34 -p.mw-filedelete-editreasons, p.mw-delete-editreasons {
 34+p.mw-filedelete-editreasons, p.mw-delete-editreasons,
 35+p.mw-revdel-editreasons {
3536 float: left;
3637 }
3738 table.filehistory th {
Index: trunk/phase3/skins/common/shared.css
@@ -122,7 +122,8 @@
123123
124124 /* Convenience links to edit block, delete and protect reasons */
125125 p.mw-ipb-conveniencelinks, p.mw-protect-editreasons,
126 -p.mw-filedelete-editreasons, p.mw-delete-editreasons {
 126+p.mw-filedelete-editreasons, p.mw-delete-editreasons,
 127+p.mw-revdel-editreasons {
127128 font-size: 90%;
128129 float: right;
129130 }
Index: trunk/phase3/includes/specials/SpecialRevisiondelete.php
@@ -360,31 +360,55 @@
361361 // Normal sysops can always see what they did, but can't always change it
362362 if( !$UserAllowed ) return;
363363
364 - $wgOut->addHTML(
365 - Xml::openElement( 'form', array( 'method' => 'post',
 364+ $out = Xml::openElement( 'form', array( 'method' => 'post',
366365 'action' => $this->getTitle()->getLocalUrl( array( 'action' => 'submit' ) ),
367366 'id' => 'mw-revdel-form-revisions' ) ) .
368 - Xml::openElement( 'fieldset' ) .
369 - Xml::element( 'legend', null, wfMsg( 'revdelete-legend' ) ) .
 367+ Xml::fieldset( wfMsg( 'revdelete-legend' ) ) .
 368+ Xml::openElement( 'table' ) .
370369 $this->buildCheckBoxes( $bitfields ) .
371 - "\n<table><tr>\n" .
372 - '<td>' . Xml::label( wfMsg('revdelete-log'), 'wpRevDeleteReasonList' ) . '</td>' .
373 - '<td>' . Xml::listDropDown( 'wpRevDeleteReasonList',
374 - wfMsgForContent( 'revdelete-reason-dropdown' ),
375 - wfMsgForContent( 'revdelete-reasonotherlist' ), '', 'wpReasonDropDown', 1
376 - ) . '</td>' .
377 - "\n</tr><tr>\n" .
378 - '<td>' . Xml::label( wfMsg( 'revdelete-otherreason' ), 'wpReason' ) . '</td>' .
379 - '<td>' . Xml::input( 'wpReason', 60, $this->otherReason, array('id'=>'wpReason') ) . '</td>' .
380 - "\n</tr></table>\n" .
381 - Xml::submitButton( wfMsg( 'revdelete-submit' ), array( 'name' => 'wpSubmit' ) ) .
 370+ "<tr>\n" .
 371+ '<td class="mw-label">' .
 372+ Xml::label( wfMsg( 'revdelete-log' ), 'wpRevDeleteReasonList' ) .
 373+ '</td>' .
 374+ '<td class="mw-input">' .
 375+ Xml::listDropDown( 'wpRevDeleteReasonList',
 376+ wfMsgForContent( 'revdelete-reason-dropdown' ),
 377+ wfMsgForContent( 'revdelete-reasonotherlist' ), '', 'wpReasonDropDown', 1
 378+ ) .
 379+ '</td>' .
 380+ "</tr><tr>\n" .
 381+ '<td class="mw-label">' .
 382+ Xml::label( wfMsg( 'revdelete-otherreason' ), 'wpReason' ) .
 383+ '</td>' .
 384+ '<td class="mw-input">' .
 385+ Xml::input( 'wpReason', 60, $this->otherReason, array( 'id' => 'wpReason' ) ) .
 386+ '</td>' .
 387+ "</tr><tr>\n" .
 388+ '<td></td>' .
 389+ '<td class="mw-submit">' .
 390+ Xml::submitButton( wfMsg( 'revdelete-submit' ), array( 'name' => 'wpSubmit' ) ) .
 391+ '</td>' .
 392+ "</tr>\n" .
 393+ Xml::closeElement( 'table' ) .
382394 Xml::hidden( 'wpEditToken', $wgUser->editToken() ) .
383395 Xml::hidden( 'target', $this->targetObj->getPrefixedText() ) .
384396 Xml::hidden( 'type', $this->typeName ) .
385397 Xml::hidden( 'ids', implode( ',', $this->ids ) ) .
386 - Xml::closeElement( 'fieldset' ) .
387 - Xml::closeElement( 'form' ) . "\n"
388 - );
 398+ Xml::closeElement( 'fieldset' ) . "\n";
 399+
 400+ if( $wgUser->isAllowed( 'editinterface' ) ) {
 401+ $title = Title::makeTitle( NS_MEDIAWIKI, 'revdelete-reason-dropdown' );
 402+ $link = $wgUser->getSkin()->link(
 403+ $title,
 404+ wfMsgHtml( 'revdelete-edit-reasonlist' ),
 405+ array(),
 406+ array( 'action' => 'edit' )
 407+ );
 408+ $out .= Xml::tags( 'p', array( 'class' => 'mw-revdel-editreasons' ), $link ) . "\n";
 409+ }
 410+ $out .= Xml::closeElement( 'form' ) . "\n";
 411+
 412+ $wgOut->addHTML( $out );
389413 }
390414
391415 /**
@@ -411,8 +435,8 @@
412436 $innerHTML = Xml::checkLabel( wfMsg($message), $name, $name, $bitfields & $field );
413437 if( $field == Revision::DELETED_RESTRICTED )
414438 $innerHTML = "<b>$innerHTML</b>";
415 - $line = Xml::tags( 'div', null, $innerHTML );
416 - $html .= $line;
 439+ $line = Xml::tags( 'td', array( 'class' => 'mw-input' ), $innerHTML );
 440+ $html .= '<tr><td></td>' . $line . "</tr>\n";
417441 }
418442 return $html;
419443 }
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -1500,6 +1500,7 @@
15011501 ** Inappropriate personal information',
15021502 'revdelete-otherreason' => 'Other/additional reason:',
15031503 'revdelete-reasonotherlist' => 'Other reason',
 1504+'revdelete-edit-reasonlist' => 'Edit delete reasons',
15041505
15051506 # Suppression log
15061507 'suppressionlog' => 'Suppression log',

Follow-up revisions

RevisionCommit summaryAuthorDate
r55828* follow-up to r55821 (duplication of 'filedelete-edit-reasonlist' to 'revdel...siebrand17:23, 4 September 2009

Comments

#Comment by Aaron Schulz (talk | contribs)   04:34, 5 September 2009

Why are the checkboxes spaced in so far? It looks terrible. Can they visually be moved back?

#Comment by Raymond (talk | contribs)   06:20, 5 September 2009

They can by reverting the changes in $this->buildCheckBoxes().

But my changes makes the form consistent with other forms, compare with move/protect/delete page. One visible difference: In these forme the checkboxes are beneath the reason field.

#Comment by Raymond (talk | contribs)   08:16, 6 September 2009

Aaron shifted them left again with r55862. Tested on translatewiki. Changing status to the previously OK by Brion.

Status & tagging log