r99336 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99335‎ | r99336 | r99337 >
Date:05:51, 9 October 2011
Author:aaron
Status:deferred (Comments)
Tags:
Comment:
* Don't add the pending account notice to the site notice (which is broken wrt to collapsing it)
* Fixed nonsensically named CSS "confirmaccount-time-" classes
Modified paths:
  • /trunk/extensions/ConfirmAccount/ConfirmAccount.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css (modified) (history)
  • /trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ConfirmAccount/ConfirmAccount.php
@@ -92,7 +92,7 @@
9393 # Check for collisions
9494 $wgHooks['AbortNewAccount'][] = 'ConfirmAccountUIHooks::checkIfAccountNameIsPending';
9595 # Status header like "new messages" bar
96 -$wgHooks['SiteNoticeAfter'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice';
 96+$wgHooks['BeforePageDisplay'][] = 'ConfirmAccountUIHooks::confirmAccountsNotice';
9797
9898 # Register admin pages for AdminLinks extension.
9999 $wgHooks['AdminLinks'][] = 'ConfirmAccountUIHooks::confirmAccountAdminLinks';
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccountUI.hooks.php
@@ -48,15 +48,14 @@
4949 }
5050
5151 /**
52 - * FIXME: don't just tack on to general site notice
53 - *
 52+ * Add "x email-confirmed open account requests" notice
5453 * @param $notice
5554 * @return bool
5655 */
57 - public static function confirmAccountsNotice( &$notice ) {
 56+ public static function confirmAccountsNotice( OutputPage &$out, Skin &$skin ) {
5857 global $wgConfirmAccountNotice;
5958
60 - $context = RequestContext::getMain();
 59+ $context = $out->getContext();
6160 if ( !$wgConfirmAccountNotice || !$context->getUser()->isAllowed( 'confirmaccount' ) ) {
6261 return true;
6362 }
@@ -67,11 +66,13 @@
6867 }
6968 $count = ConfirmAccount::getOpenEmailConfirmedCount( '*' );
7069 if ( $count > 0 ) {
71 - $message = wfMsgExt( 'confirmaccount-newrequests', 'parsemag', $count );
72 - $notice .= '<div id="mw-confirmaccount-msg" class="mw-confirmaccount-bar">' .
73 - $context->getOutput()->parse( $message ) . '</div>';
 70+ $out->prependHtml(
 71+ '<div id="mw-confirmaccount-msg" class="plainlinks mw-confirmaccount-bar">' .
 72+ $out->parse( wfMsg( 'confirmaccount-newrequests', $count ), false ) .
 73+ '</div>'
 74+ );
7475
75 - $context->getOutput()->addModules( 'ext.confirmAccount' ); // CSS
 76+ $out->addModules( 'ext.confirmAccount' ); // CSS
7677 }
7778 return true;
7879 }
Index: trunk/extensions/ConfirmAccount/presentation/specialpages/actions/ConfirmAccount_body.php
@@ -919,7 +919,7 @@
920920 }
921921 $time = $this->getLang()->timeanddate( wfTimestamp(TS_MW, $row->acr_registration), true );
922922
923 - $r = "<li class='mw-confirmaccount-time-{$this->queueType}'>";
 923+ $r = "<li class='mw-confirmaccount-type-{$this->queueType}'>";
924924
925925 $r .= $time." (<strong>{$link}</strong>)";
926926 # Auto-rejected accounts have a user ID of zero
Index: trunk/extensions/ConfirmAccount/presentation/modules/confirmaccount.css
@@ -1,14 +1,12 @@
 2+/* RC pending account request notice */
23 .mw-confirmaccount-bar {
 4+ padding: 3px;
 5+ margin: 5px;
 6+ border: 1px solid #990000;
37 background-color: #f9f9f9;
4 - padding: 0px;
5 - font-size: 80%;
6 - margin-left: 10px;
7 - margin-right: 10px;
8 - text-align: center;
9 - float: right;
108 }
119
12 -.mw-confirmaccount-time-0 {
 10+.mw-confirmaccount-type-0 {
1311 background-color: #f0fff0;
1412 }
1513
@@ -16,7 +14,7 @@
1715 background-color: #f9f9f9;
1816 }
1917
20 -.mw-confirmaccount-time-1 {
 18+.mw-confirmaccount-type-1 {
2119 background-color: #f0ffff;
2220 }
2321
Index: trunk/extensions/ConfirmAccount/presentation/ConfirmAccount.i18n.php
@@ -80,7 +80,7 @@
8181 'requestaccount-loginnotice' => 'To obtain a user account, you must \'\'\'[[Special:RequestAccount|request one]]\'\'\'.',
8282
8383 # Site message for admins
84 - 'confirmaccount-newrequests' => '\'\'\'$1\'\'\' open e-mail-confirmed [[Special:ConfirmAccounts|account {{PLURAL:$1|request|requests}}]] pending',
 84+ 'confirmaccount-newrequests' => '\'\'\'$1\'\'\' open e-mail-confirmed [[Special:ConfirmAccounts|account {{PLURAL:$1|request|requests}}]] {{PLURAL:$1|is|are}} pending. \'\'\'Your attention is needed!\'\'\'',
8585
8686 # Confirm account page
8787 'confirmaccounts' => 'Confirm account requests',

Follow-up revisions

RevisionCommit summaryAuthorDate
r99338Fixed backwards PLURAL usage and improved text in confirmaccount-newrequests ...aaron06:17, 9 October 2011

Comments

#Comment by Siebrand (talk | contribs)   06:11, 9 October 2011

Why not add "is/are pending" to the link description? Makes the link stand out more and creates a larger click target (simplifies messAge by reducing number of PLURAL uses in the process).

#Comment by Aaron Schulz (talk | contribs)   06:32, 9 October 2011

Status & tagging log