Fix user-friendlyness of block confirmation screen
authorm4tx <m4tx@m4tx.pl>
Mon, 23 Dec 2013 11:37:03 +0000 (12:37 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Sat, 4 Jan 2014 13:19:58 +0000 (14:19 +0100)
* "Confirm block" checkbox is now highlighted
* Added "check the box if you're sure" message to the errors at the top

Bug: 58783
Change-Id: I2b496d763a14fe47d7458525cb1e8bb9fa5788f6

includes/specials/SpecialBlock.php
languages/messages/MessagesEn.php
languages/messages/MessagesQqq.php
maintenance/language/messages.inc
resources/Resources.php
resources/mediawiki.special/mediawiki.special.block.css [new file with mode: 0644]

index fa5ec29..1aa8006 100644 (file)
@@ -296,14 +296,14 @@ class SpecialBlock extends FormSpecialPage {
                if ( $this->requestedHideUser ) {
                        $fields['Confirm']['type'] = 'check';
                        unset( $fields['Confirm']['default'] );
-                       $this->preErrors[] = 'ipb-confirmhideuser';
+                       $this->preErrors[] = array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
                }
 
                # Or if the user is trying to block themselves
                if ( (string)$this->target === $this->getUser()->getName() ) {
                        $fields['Confirm']['type'] = 'check';
                        unset( $fields['Confirm']['default'] );
-                       $this->preErrors[] = 'ipb-blockingself';
+                       $this->preErrors[] = array( 'ipb-blockingself', 'ipb-confirmaction' );
                }
        }
 
@@ -630,7 +630,7 @@ class SpecialBlock extends FormSpecialPage {
                        if ( $target === $performer->getName() &&
                                ( $data['PreviousTarget'] !== $target || !$data['Confirm'] )
                        ) {
-                               return array( 'ipb-blockingself' );
+                               return array( 'ipb-blockingself', 'ipb-confirmaction' );
                        }
                } elseif ( $type == Block::TYPE_RANGE ) {
                        $userId = 0;
@@ -678,7 +678,7 @@ class SpecialBlock extends FormSpecialPage {
                                # Disallow hiding users with many edits for performance.
                                return array( 'ipb_hide_invalid' );
                        } elseif ( !$data['Confirm'] ) {
-                               return array( 'ipb-confirmhideuser' );
+                               return array( 'ipb-confirmhideuser', 'ipb-confirmaction' );
                        }
                }
 
index f645531..781beff 100644 (file)
@@ -3301,6 +3301,7 @@ Fill in a specific reason below (for example, citing particular pages that were
 See the [[Special:BlockList|block list]] to review blocks.',
 'ipb-blockingself'                => 'You are about to block yourself! Are you sure you want to do that?',
 'ipb-confirmhideuser'             => 'You are about to block a user with "hide user" enabled. This will suppress the user\'s name in all lists and log entries. Are you sure you want to do that?',
+'ipb-confirmaction'               => 'If you are sure you really want to do it, please check the "{{int:ipb-confirm}}" field at the bottom.',
 'ipb-edit-dropdown'               => 'Edit block reasons',
 'ipb-unblock-addr'                => 'Unblock $1',
 'ipb-unblock'                     => 'Unblock a username or IP address',
index e99ab8e..13442b6 100644 (file)
@@ -6330,6 +6330,11 @@ See also:
 
 See also:
 * {{msg-mw|Ipb-blockingself}}',
+'ipb-confirmaction' => 'Used to inform the user they need to check the "Confirm block" checkbox on [[Special:Block]] ({{mw-msg|ipb-confirm}}) to continue.
+
+See also:
+* {{msg-mw|Ipb-blockingself}}
+* {{msg-mw|Ipb-confirmhideuser}}',
 'ipb-edit-dropdown' => 'Shown beneath the user block form on the right side. It is a link to {{msg-mw|Ipbreason-dropdown|notext=1}}.
 
 See also:
index 5e463b2..68678ee 100644 (file)
@@ -2273,6 +2273,7 @@ $wgMessageStructure = array(
                'blockipsuccesstext',
                'ipb-blockingself',
                'ipb-confirmhideuser',
+               'ipb-confirmaction',
                'ipb-edit-dropdown',
                'ipb-unblock-addr',
                'ipb-unblock',
index d280c75..bcac838 100644 (file)
@@ -1010,6 +1010,7 @@ return array(
        ),
        'mediawiki.special.block' => array(
                'scripts' => 'resources/mediawiki.special/mediawiki.special.block.js',
+               'styles' => 'resources/mediawiki.special/mediawiki.special.block.css',
                'dependencies' => array(
                        'mediawiki.util',
                ),
diff --git a/resources/mediawiki.special/mediawiki.special.block.css b/resources/mediawiki.special/mediawiki.special.block.css
new file mode 100644 (file)
index 0000000..899a9f3
--- /dev/null
@@ -0,0 +1,7 @@
+/**
+ * Styling for Special:Block
+ */
+
+label[for="mw-input-wpConfirm"] {
+       font-weight: bold;
+}