Merge "Allow minor edits to be filtered out of Special:Contributions"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 9 Jun 2016 20:13:28 +0000 (20:13 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 9 Jun 2016 20:13:28 +0000 (20:13 +0000)
1  2 
includes/api/i18n/en.json
includes/api/i18n/qqq.json
includes/specials/pagers/ContribsPager.php
languages/i18n/en.json
languages/i18n/qqq.json

@@@ -60,7 -60,6 +60,7 @@@
        "apihelp-compare-example-1": "Create a diff between revision 1 and 2.",
  
        "apihelp-createaccount-description": "Create a new user account.",
 +      "apihelp-createaccount-param-preservestate": "If <kbd>[[Special:ApiHelp/query+authmanagerinfo|action=query&meta=authmanagerinfo]]</kbd> returned true for <samp>hasprimarypreservedstate</samp>, requests marked as <samp>primary-required</samp> should be omitted. If it returned a non-empty value for <samp>preservedusername</samp>, that username must be used for the <var>username</var> parameter.",
        "apihelp-createaccount-example-create": "Start the process of creating user <kbd>Example</kbd> with password <kbd>ExamplePassword</kbd>.",
        "apihelp-createaccount-param-name": "Username.",
        "apihelp-createaccount-param-password": "Password (ignored if <var>$1mailpassword</var> is set).",
        "apihelp-feedcontributions-param-deletedonly": "Show only deleted contributions.",
        "apihelp-feedcontributions-param-toponly": "Only show edits that are latest revisions.",
        "apihelp-feedcontributions-param-newonly": "Only show edits that are page creations.",
+       "apihelp-feedcontributions-param-hideminor": "Hide minor edits.",
        "apihelp-feedcontributions-param-showsizediff": "Show the size difference between revisions.",
        "apihelp-feedcontributions-example-simple": "Return contributions for user <kbd>Example</kbd>.",
  
        "apihelp-query+prefixsearch-param-limit": "Maximum number of results to return.",
        "apihelp-query+prefixsearch-param-offset": "Number of results to skip.",
        "apihelp-query+prefixsearch-example-simple": "Search for page titles beginning with <kbd>meaning</kbd>.",
 +      "apihelp-query+prefixsearch-param-profile": "Search profile to use.",
  
        "apihelp-query+protectedtitles-description": "List all titles protected from creation.",
        "apihelp-query+protectedtitles-param-namespace": "Only list titles in these namespaces.",
        "apihelp-query+search-param-what": "Which type of search to perform.",
        "apihelp-query+search-param-info": "Which metadata to return.",
        "apihelp-query+search-param-prop": "Which properties to return:",
 +      "apihelp-query+search-param-qiprofile": "Query independent profile to use (affects ranking algorithm).",
        "apihelp-query+search-paramvalue-prop-size": "Adds the size of the page in bytes.",
        "apihelp-query+search-paramvalue-prop-wordcount": "Adds the word count of the page.",
        "apihelp-query+search-paramvalue-prop-timestamp": "Adds the timestamp of when the page was last edited.",
@@@ -62,7 -62,6 +62,7 @@@
        "apihelp-compare-param-torev": "{{doc-apihelp-param|compare|torev}}",
        "apihelp-compare-example-1": "{{doc-apihelp-example|compare}}",
        "apihelp-createaccount-description": "{{doc-apihelp-description|createaccount}}",
 +      "apihelp-createaccount-param-preservestate": "{{doc-apihelp-param|createaccount|preservestate|info=This message is displayed in addition to {{msg-mw|api-help-authmanagerhelper-preservestate}}.}}",
        "apihelp-createaccount-example-create": "{{doc-apihelp-example|createaccount}}",
        "apihelp-createaccount-param-name": "{{doc-apihelp-param|createaccount|name}}\n{{Identical|Username}}",
        "apihelp-createaccount-param-password": "{{doc-apihelp-param|createaccount|password}}",
        "apihelp-feedcontributions-param-deletedonly": "{{doc-apihelp-param|feedcontributions|deletedonly}}",
        "apihelp-feedcontributions-param-toponly": "{{doc-apihelp-param|feedcontributions|toponly}}",
        "apihelp-feedcontributions-param-newonly": "{{doc-apihelp-param|feedcontributions|newonly}}",
+       "apihelp-feedcontributions-param-hideminor": "{{doc-apihelp-param|feedcontributions|hideminor}}",
        "apihelp-feedcontributions-param-showsizediff": "{{doc-apihelp-param|feedcontributions|showsizediff}}",
        "apihelp-feedcontributions-example-simple": "{{doc-apihelp-example|feedcontributions}}",
        "apihelp-feedrecentchanges-description": "{{doc-apihelp-description|feedrecentchanges}}",
        "apihelp-query+prefixsearch-param-limit": "{{doc-apihelp-param|query+prefixsearch|limit}}",
        "apihelp-query+prefixsearch-param-offset": "{{doc-apihelp-param|query+prefixsearch|offset}}",
        "apihelp-query+prefixsearch-example-simple": "{{doc-apihelp-example|query+prefixsearch}}",
 +      "apihelp-query+prefixsearch-param-profile": "{{doc-apihelp-param|query+prefixsearch|profile|paramvalues=1}}",
        "apihelp-query+protectedtitles-description": "{{doc-apihelp-description|query+protectedtitles}}",
        "apihelp-query+protectedtitles-param-namespace": "{{doc-apihelp-param|query+protectedtitles|namespace}}",
        "apihelp-query+protectedtitles-param-level": "{{doc-apihelp-param|query+protectedtitles|level}}",
        "apihelp-query+search-param-what": "{{doc-apihelp-param|query+search|what}}",
        "apihelp-query+search-param-info": "{{doc-apihelp-param|query+search|info}}",
        "apihelp-query+search-param-prop": "{{doc-apihelp-param|query+search|prop|paramvalues=1}}",
 +      "apihelp-query+search-param-qiprofile": "{{doc-apihelp-param|query+search|qiprofile|paramvalues=1}}",
        "apihelp-query+search-paramvalue-prop-size": "{{doc-apihelp-paramvalue|query+search|prop|size}}",
        "apihelp-query+search-paramvalue-prop-wordcount": "{{doc-apihelp-paramvalue|query+search|prop|wordcount}}",
        "apihelp-query+search-paramvalue-prop-timestamp": "{{doc-apihelp-paramvalue|query+search|prop|timestamp}}",
@@@ -64,6 -64,7 +64,7 @@@ class ContribsPager extends ReverseChro
                $this->deletedOnly = !empty( $options['deletedOnly'] );
                $this->topOnly = !empty( $options['topOnly'] );
                $this->newOnly = !empty( $options['newOnly'] );
+               $this->hideMinor = !empty( $options['hideMinor'] );
  
                $year = isset( $options['year'] ) ? $options['year'] : false;
                $month = isset( $options['month'] ) ? $options['month'] : false;
                        $condition[] = 'rev_parent_id = 0';
                }
  
+               if ( $this->hideMinor ) {
+                       $condition[] = 'rev_minor_edit = 0';
+               }
                return [ $tables, $index, $condition, $join_conds ];
        }
  
                                $userlink = '';
                        }
  
 +                      $flags = [];
                        if ( $rev->getParentId() === 0 ) {
 -                              $nflag = ChangesList::flag( 'newpage' );
 -                      } else {
 -                              $nflag = '';
 +                              $flags[] = ChangesList::flag( 'newpage' );
                        }
  
                        if ( $rev->isMinor() ) {
 -                              $mflag = ChangesList::flag( 'minor' );
 -                      } else {
 -                              $mflag = '';
 +                              $flags[] = ChangesList::flag( 'minor' );
                        }
  
                        $del = Linker::getRevDeleteLink( $user, $rev, $page );
                        $diffHistLinks = $this->msg( 'parentheses' )
                                ->rawParams( $difftext . $this->messages['pipe-separator'] . $histlink )
                                ->escaped();
 -                      $ret = "{$del}{$d} {$diffHistLinks}{$chardiff}{$nflag}{$mflag} ";
 -                      $ret .= "{$link}{$userlink} {$comment} {$topmarktext}";
 -
 -                      # Denote if username is redacted for this edit
 -                      if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
 -                              $ret .= " <strong>" .
 -                                      $this->msg( 'rev-deleted-user-contribs' )->escaped() .
 -                                      "</strong>";
 -                      }
  
                        # Tags, if any.
                        list( $tagSummary, $newClasses ) = ChangeTags::formatSummaryRow(
                                $this->getContext()
                        );
                        $classes = array_merge( $classes, $newClasses );
 -                      $ret .= " $tagSummary";
 +
 +                      $templateParams = [
 +                              'del' => $del,
 +                              'timestamp' => $d,
 +                              'diffHistLinks' => $diffHistLinks,
 +                              'charDifference' => $chardiff,
 +                              'flags' => $flags,
 +                              'articleLink' => $link,
 +                              'userlink' => $userlink,
 +                              'logText' => $comment,
 +                              'topmarktext' => $topmarktext,
 +                              'tagSummary' => $tagSummary,
 +                      ];
 +
 +                      # Denote if username is redacted for this edit
 +                      if ( $rev->isDeleted( Revision::DELETED_USER ) ) {
 +                              $templateParams['rev-deleted-user-contribs'] =
 +                                      $this->msg( 'rev-deleted-user-contribs' )->escaped();
 +                      }
 +
 +                      $templateParser = new TemplateParser();
 +                      $ret = $templateParser->processTemplate(
 +                              'SpecialContributionsLine',
 +                              $templateParams
 +                      );
                }
  
                // Let extensions add data
                Hooks::run( 'ContributionsLineEnding', [ $this, &$ret, $row, &$classes ] );
  
 +              // TODO: Handle exceptions in the catch block above.  Do any extensions rely on
 +              // receiving empty rows?
 +
                if ( $classes === [] && $ret === '' ) {
                        wfDebug( "Dropping Special:Contribution row that could not be formatted\n" );
 -                      $ret = "<!-- Could not format Special:Contribution row. -->\n";
 -              } else {
 -                      $ret = Html::rawElement( 'li', [ 'class' => $classes ], $ret ) . "\n";
 +                      return "<!-- Could not format Special:Contribution row. -->\n";
                }
  
 -              return $ret;
 +              // FIXME: The signature of the ContributionsLineEnding hook makes it
 +              // very awkward to move this LI wrapper into the template.
 +              return Html::rawElement( 'li', [ 'class' => $classes ], $ret ) . "\n";
        }
  
        /**
diff --combined languages/i18n/en.json
        "protectedpagetext": "This page has been protected to prevent editing or other actions.",
        "viewsourcetext": "You can view and copy the source of this page.",
        "viewyourtext": "You can view and copy the source of <strong>your edits</strong> to this page.",
 -      "protectedinterface": "This page provides interface text for the software on this wiki, and is protected to prevent abuse.\nTo add or change translations for all wikis, please use [//translatewiki.net/ translatewiki.net], the MediaWiki localisation project.",
 +      "protectedinterface": "This page provides interface text for the software on this wiki, and is protected to prevent abuse.\nTo add or change translations for all wikis, please use [https://translatewiki.net/ translatewiki.net], the MediaWiki localisation project.",
        "editinginterface": "<strong>Warning:</strong> You are editing a page that is used to provide interface text for the software.\nChanges to this page will affect the appearance of the user interface for other users on this wiki.",
 -      "translateinterface": "To add or change translations for all wikis, please use [//translatewiki.net/ translatewiki.net], the MediaWiki localisation project.",
 +      "translateinterface": "To add or change translations for all wikis, please use [https://translatewiki.net/ translatewiki.net], the MediaWiki localisation project.",
        "cascadeprotected": "This page has been protected from editing because it is transcluded in the following {{PLURAL:$1|page, which is|pages, which are}} protected with the \"cascading\" option turned on:\n$2",
        "namespaceprotected": "You do not have permission to edit pages in the <strong>$1</strong> namespace.",
        "customcssprotected": "You do not have permission to edit this CSS page because it contains another user's personal settings.",
        "resetpass-temp-password": "Temporary password:",
        "resetpass-abort-generic": "Password change has been aborted by an extension.",
        "resetpass-expired": "Your password has expired. Please set a new password to log in.",
 -      "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.",
 -      "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:resetpass-submit-cancel}}\" to reset it later.",
 +      "resetpass-expired-soft": "Your password has expired and needs to be reset. Please choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.",
 +      "resetpass-validity-soft": "Your password is not valid: $1\n\nPlease choose a new password now, or click \"{{int:authprovider-resetpass-skip-label}}\" to reset it later.",
        "passwordreset": "Reset password",
        "passwordreset-text-one": "Complete this form to receive a temporary password via email.",
        "passwordreset-text-many": "{{PLURAL:$1|Fill in one of the fields to receive a temporary password via email.}}",
        "upload-http-error": "An HTTP error occurred: $1",
        "upload-copy-upload-invalid-domain": "Copy uploads are not available from this domain.",
        "upload-foreign-cant-upload": "This wiki is not configured to upload files to the requested foreign file repository.",
 +      "upload-foreign-cant-load-config": "Loading file upload configuration for the foreign file repository failed.",
        "upload-dialog-title": "Upload file",
        "upload-dialog-button-cancel": "Cancel",
        "upload-dialog-button-done": "Done",
        "apisandbox-summary": "",
        "apisandbox-jsonly": "JavaScript is required to use the API sandbox.",
        "apisandbox-api-disabled": "The API is disabled on this site.",
 -      "apisandbox-intro": "Use this page to experiment with the <strong>MediaWiki web service API</strong>.\nRefer to [[mw:API:Main page|the API documentation]] for further details of API usage. Example: [//www.mediawiki.org/wiki/API#A_simple_example get the content of a Main Page]. Select an action to see more examples.\n\nNote that, although this is a sandbox, actions you carry out on this page may modify the wiki.",
 +      "apisandbox-intro": "Use this page to experiment with the <strong>MediaWiki web service API</strong>.\nRefer to [[mw:API:Main page|the API documentation]] for further details of API usage. Example: [https://www.mediawiki.org/wiki/API#A_simple_example get the content of a Main Page]. Select an action to see more examples.\n\nNote that, although this is a sandbox, actions you carry out on this page may modify the wiki.",
        "apisandbox-fullscreen": "Expand panel",
        "apisandbox-fullscreen-tooltip": "Expand the sandbox panel to fill the browser window.",
        "apisandbox-unfullscreen": "Show page",
        "sp-contributions-username": "IP address or username:",
        "sp-contributions-toponly": "Only show edits that are latest revisions",
        "sp-contributions-newonly": "Only show edits that are page creations",
+       "sp-contributions-hideminor": "Hide minor edits",
        "sp-contributions-submit": "Search",
        "sp-contributions-explain": "",
        "sp-contributions-footer": "-",
        "allmessagesname": "Name",
        "allmessagesdefault": "Default message text",
        "allmessagescurrent": "Current message text",
 -      "allmessagestext": "This is a list of system messages available in the MediaWiki namespace.\nPlease visit [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation MediaWiki Localisation] and [//translatewiki.net translatewiki.net] if you wish to contribute to the generic MediaWiki localisation.",
 +      "allmessagestext": "This is a list of system messages available in the MediaWiki namespace.\nPlease visit [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation MediaWiki Localisation] and [https://translatewiki.net translatewiki.net] if you wish to contribute to the generic MediaWiki localisation.",
        "allmessagesnotsupportedDB": "This page cannot be used because <strong>$wgUseDatabaseMessages</strong> has been disabled.",
        "allmessages-filter-legend": "Filter",
        "allmessages-filter": "Filter by customization state:",
        "cannotauth-not-allowed": "You are not allowed to use this page",
        "changecredentials" : "Change credentials",
        "changecredentials-submit": "Change credentials",
 -      "changecredentials-submit-cancel": "Cancel",
        "changecredentials-invalidsubpage": "$1 is not a valid credential type.",
        "changecredentials-success": "Your credentials have been changed.",
        "removecredentials" : "Remove credentials",
        "removecredentials-submit": "Remove credentials",
 -      "removecredentials-submit-cancel": "Cancel",
        "removecredentials-invalidsubpage": "$1 is not a valid credential type.",
        "removecredentials-success": "Your credentials have been removed.",
        "credentialsform-provider": "Credentials type:",
        "linkaccounts-success-text": "The account was linked.",
        "linkaccounts-submit": "Link accounts",
        "unlinkaccounts": "Unlink accounts",
 -      "unlinkaccounts-success": "The account was unlinked."
 +      "unlinkaccounts-success": "The account was unlinked.",
 +      "authenticationdatachange-ignored": "The authentication data change was not handled. Maybe no provider was configured?"
  }
diff --combined languages/i18n/qqq.json
        "upload-http-error": "Parameters:\n* $1 - error message",
        "upload-copy-upload-invalid-domain": "Error message shown if a user is trying to upload (i.e. copy) a file from a website that is not in $wgCopyUploadsDomains (if set).\n\nSee also:\n* {{msg-mw|http-invalid-url}}\n* {{msg-mw|tmp-create-error}}\n* {{msg-mw|tmp-write-error}}",
        "upload-foreign-cant-upload": "Error message shown when a user is trying to upload a file to foreign repository that is not configured to receive file uploads from current wiki.",
 +      "upload-foreign-cant-load-config": "Error message shown when a user is trying to upload a file to foreign repository and the foreign wiki is down or otherwise unable to respond to API requests.",
        "upload-dialog-title": "Title of the upload dialog box\n{{Identical|Upload file}}",
        "upload-dialog-button-cancel": "Button to cancel the dialog\n{{Identical|Cancel}}",
        "upload-dialog-button-done": "Button to close the dialog once upload is complete\n{{Identical|Done}}",
        "sp-contributions-username": "This message appears whenever someone requests [[Special:Contributions]].\n{{Identical|IP address or username}}",
        "sp-contributions-toponly": "A checkbox at [[Special:Mycontributions|Special:Contributions]]",
        "sp-contributions-newonly": "Used as checkbox label at [[Special:Mycontributions|Special:Contributions]].\n\n\"page creation\" means the \"first revision\" of a page.\n\nPreceded by {{msg-mw|Sp-contributions-toponly}}.",
+       "sp-contributions-hideminor": "Used as checkbox label at [[Special:Mycontributions|Special:Contributions]].\n\nSee also:\n* {{msg-mw|Tog-hideminor}}",
        "sp-contributions-submit": "{{Identical|Search}}",
        "sp-contributions-explain": "{{optional}}",
        "sp-contributions-footer": "{{ignored}}This is the footer for users that are not anonymous or newbie on [[Special:Contributions]].",
        "cannotauth-not-allowed": "Text of the error page shown when the user tries t use an authentication-related page they should not have access to.",
        "changecredentials": "Title of the special page [[Special:ChangeCredentials]] which allows changing authentication credentials (such as the password).",
        "changecredentials-submit": "Used on [[Special:ChangeCredentials]].",
 -      "changecredentials-submit-cancel": "Used on [[Special:ChangeCredentials]].\n{{Identical|Cancel}}",
        "changecredentials-invalidsubpage": "Error message shown when using [[Special:ChangeCredentials]] with an invalid type.\n\nParameters:\n* $1 - subpage name.",
        "changecredentials-success": "Success message after using [[Special:ChangeCredentials]].",
        "removecredentials": "Title of the special page [[Special:RemoveCredentials]] which allows removing authentication credentials (such as a two-factor token).",
        "removecredentials-submit": "Used on [[Special:RemoveCredentials]].",
 -      "removecredentials-submit-cancel": "Used on [[Special:RemoveCredentials]].\n{{Identical|Cancel}}",
        "removecredentials-invalidsubpage": "Error message shown when using [[Special:RemoveCredentials]] with an invalid type.\n\nParameters:\n* $1 - subpage name.",
        "removecredentials-success": "Success message after using [[Special:RemoveCredentials]].",
        "credentialsform-provider": "Shown on [[Special:ChangeCredentials]]/[[Special:RemoveCredentials]] as the label for the authentication type (e.g. \"password\", \"English Wikipedia via OAuth\")",
        "linkaccounts-success-text": "Text shown on top of the form after a successful action.",
        "linkaccounts-submit": "Text of the main submit button on [[Special:LinkAccounts]] (when there is one)",
        "unlinkaccounts": "Title of the special page [[Special:UnlinkAccounts]] which allows the user to remove linked remote accounts.",
 -      "unlinkaccounts-success": "Account unlinking form success message"
 +      "unlinkaccounts-success": "Account unlinking form success message",
 +      "authenticationdatachange-ignored": "Shown when authentication data change was unsuccessful due to configuration problems."
  }