SpecialMovepage: Use 'warningbox'/'errorbox' for warnings/errors
authorBartosz Dziewoński <matma.rex@gmail.com>
Fri, 27 Nov 2015 02:13:38 +0000 (03:13 +0100)
committerBartosz Dziewoński <matma.rex@gmail.com>
Wed, 20 Jan 2016 13:55:58 +0000 (14:55 +0100)
Matches the new form styling better.

Also, remove headings in warning messages. Yeah, I don't know
what was up with that, either.

Change-Id: I84ce4d32c50f91cd64d4a1502e33b4cdbadfc5f3

includes/specials/SpecialMovepage.php
languages/i18n/en.json

index 4bdad79..27d2304 100644 (file)
@@ -149,22 +149,23 @@ class MovePageForm extends UnlistedSpecialPage {
                $out->addModuleStyles( 'mediawiki.special.movePage.styles' );
                $this->addHelpLink( 'Help:Moving a page' );
 
+               $out->addWikiMsg( $this->getConfig()->get( 'FixDoubleRedirects' ) ?
+                       'movepagetext' :
+                       'movepagetext-noredirectfixer'
+               );
+
                if ( $this->oldTitle->getNamespace() == NS_USER && !$this->oldTitle->isSubpage() ) {
                        $out->wrapWikiMsg(
-                               "<div class=\"error mw-moveuserpage-warning\">\n$1\n</div>",
+                               "<div class=\"warningbox mw-moveuserpage-warning\">\n$1\n</div>",
                                'moveuserpage-warning'
                        );
                } elseif ( $this->oldTitle->getNamespace() == NS_CATEGORY ) {
                        $out->wrapWikiMsg(
-                               "<div class=\"error mw-movecategorypage-warning\">\n$1\n</div>",
+                               "<div class=\"warningbox mw-movecategorypage-warning\">\n$1\n</div>",
                                'movecategorypage-warning'
                        );
                }
 
-               $out->addWikiMsg( $this->getConfig()->get( 'FixDoubleRedirects' ) ?
-                       'movepagetext' :
-                       'movepagetext-noredirectfixer'
-               );
                $submitVar = 'wpMove';
                $confirm = false;
 
@@ -189,7 +190,10 @@ class MovePageForm extends UnlistedSpecialPage {
                if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'articleexists'
                        && $newTitle->quickUserCan( 'delete', $user )
                ) {
-                       $out->addWikiMsg( 'delete_and_move_text', $newTitle->getPrefixedText() );
+                       $out->wrapWikiMsg(
+                               "<div class='warningbox'>\n$1\n</div>\n",
+                               array( 'delete_and_move_text', $newTitle->getPrefixedText() )
+                       );
                        $submitVar = 'wpDeleteAndMove';
                        $confirm = true;
                        $err = array();
@@ -198,7 +202,13 @@ class MovePageForm extends UnlistedSpecialPage {
                if ( count( $err ) == 1 && isset( $err[0][0] ) && $err[0][0] == 'file-exists-sharedrepo'
                        && $user->isAllowed( 'reupload-shared' )
                ) {
-                       $out->addWikiMsg( 'move-over-sharedrepo', $newTitle->getPrefixedText() );
+                       $out->wrapWikiMsg(
+                               "<div class='warningbox'>\n$1\n</div>\n",
+                               array(
+                                       'move-over-sharedrepo',
+                                       $newTitle->getPrefixedText()
+                               )
+                       );
                        $submitVar = 'wpMoveOverSharedFile';
                        $err = array();
                }
@@ -228,7 +238,7 @@ class MovePageForm extends UnlistedSpecialPage {
                }
 
                if ( count( $err ) ) {
-                       $out->addHTML( "<div class='error'>\n" );
+                       $out->addHTML( "<div class='errorbox'>\n" );
                        $action_desc = $this->msg( 'action-move' )->plain();
                        $out->addWikiMsg( 'permissionserrorstext-withaction', count( $err ), $action_desc );
 
index a54a88b..43fdbd9 100644 (file)
        "move-page": "Move $1",
        "movepage-summary": "",
        "move-page-legend": "Move page",
-       "movepagetext": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nYou can update redirects that point to the original title automatically.\nIf you choose not to, be sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless the latter is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Warning!</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
-       "movepagetext-noredirectfixer": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nBe sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless it is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Warning!</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
+       "movepagetext": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nYou can update redirects that point to the original title automatically.\nIf you choose not to, be sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless the latter is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Note:</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
+       "movepagetext-noredirectfixer": "Using the form below will rename a page, moving all of its history to the new name.\nThe old title will become a redirect page to the new title.\nBe sure to check for [[Special:DoubleRedirects|double]] or [[Special:BrokenRedirects|broken redirects]].\nYou are responsible for making sure that links continue to point where they are supposed to go.\n\nNote that the page will <strong>not</strong> be moved if there is already a page at the new title, unless it is a redirect and has no past edit history.\nThis means that you can rename a page back to where it was renamed from if you make a mistake, and you cannot overwrite an existing page.\n\n<strong>Note:</strong>\nThis can be a drastic and unexpected change for a popular page;\nplease be sure you understand the consequences of this before proceeding.",
        "movepagetalktext": "If you check this box, the associated talk page will be automatically moved to new title, unless a non-empty talk page already exists there.\n\nIn this case, you will have to move or merge the page manually if desired.",
        "moveuserpage-warning": "<strong>Warning:</strong> You are about to move a user page. Please note that only the page will be moved and the user will <em>not</em> be renamed.",
        "movecategorypage-warning": "<strong>Warning:</strong> You are about to move a category page. Please note that only the page will be moved and any pages in the old category will <em>not</em> be recategorized into the new one.",
        "move-redirect-text": "",
        "category-move-redirect-override": "-",
        "revertmove": "revert",
-       "delete_and_move_text": "== Deletion required ==\nThe destination page \"[[:$1]]\" already exists.\nDo you want to delete it to make way for the move?",
+       "delete_and_move_text": "The destination page \"[[:$1]]\" already exists.\nDo you want to delete it to make way for the move?",
        "delete_and_move_confirm": "Yes, delete the page",
        "delete_and_move_reason": "Deleted to make way for move from \"[[$1]]\"",
        "selfmove": "Source and destination titles are the same;\ncannot move a page over itself.",
        "move-leave-redirect": "Leave a redirect behind",
        "protectedpagemovewarning": "<strong>Warning:</strong> This page has been protected so that only users with administrator privileges can move it.\nThe latest log entry is provided below for reference:",
        "semiprotectedpagemovewarning": "<strong>Note:</strong> This page has been protected so that only registered users can move it.\nThe latest log entry is provided below for reference:",
-       "move-over-sharedrepo": "== File exists ==\n[[:$1]] exists on a shared repository. Moving a file to this title will override the shared file.",
+       "move-over-sharedrepo": "[[:$1]] exists on a shared repository. Moving a file to this title will override the shared file.",
        "file-exists-sharedrepo": "The filename chosen is already in use on a shared repository.\nPlease choose another name.",
        "export": "Export pages",
        "export-summary": "",