RecentChanges: Allow resetting date selection
authorMoriel Schottlender <moriel@gmail.com>
Wed, 5 Apr 2017 23:05:51 +0000 (16:05 -0700)
committerMooeypoo <moriel@gmail.com>
Thu, 6 Apr 2017 17:07:58 +0000 (17:07 +0000)
Add a link that resets the date selection if it is selected.

Bug: T160028
Change-Id: I4ecff943025635f42eb70fc70c6dfdf34c314707

includes/specials/SpecialRecentchanges.php
languages/i18n/en.json
languages/i18n/qqq.json

index ae0887d..f88f09c 100644 (file)
@@ -746,6 +746,9 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                $user = $this->getUser();
                $config = $this->getConfig();
                if ( $options['from'] ) {
+                       $resetLink = $this->makeOptionsLink( $this->msg( 'rclistfromreset' ),
+                               [ 'from' => '' ], $nondefaults );
+
                        $note .= $this->msg( 'rcnotefrom' )
                                ->numParams( $options['limit'] )
                                ->params(
@@ -754,7 +757,13 @@ class SpecialRecentChanges extends ChangesListSpecialPage {
                                        $lang->userTime( $options['from'], $user )
                                )
                                ->numParams( $numRows )
-                               ->parse() . '<br />';
+                               ->parse() . ' ' .
+                               Html::rawElement(
+                                       'span',
+                                       [ 'class' => 'rcoptions-listfromreset' ],
+                                       $this->msg( 'parentheses' )->rawParams( $resetLink )->parse()
+                               ) .
+                               '<br />';
                }
 
                # Sort data for display and make sure it's unique after we've added user data.
index 37f9f7f..a49a4b4 100644 (file)
        "rcfilters-hideminor-conflicts-typeofchange": "Certain types of change cannot be designated as \"minor,\" so this filter conflicts with the following Type of Change filters: $1",
        "rcfilters-typeofchange-conflicts-hideminor": "This Type of Change filter conflicts with the \"Minor Edits\" filter. Certain types of change cannot be designated as \"minor.\"",
        "rcnotefrom": "Below {{PLURAL:$5|is the change|are the changes}} since <strong>$3, $4</strong> (up to <strong>$1</strong> shown).",
+       "rclistfromreset": "Reset date selection",
        "rclistfrom": "Show new changes starting from $2, $3",
        "rcshowhideminor": "$1 minor edits",
        "rcshowhideminor-show": "Show",
index 8dd6d0f..01a8fe7 100644 (file)
        "rcfilters-typeofchange-conflicts-hideminor": "Tooltip shown when hovering over a Type of change filter tag, when the Minor edits filter is also selected.\n\n\"Minor edits\" is {{msg-mw|rcfilters-filter-minor-label}}.\n\n\"Type of change\" is {{msg-mw|rcfilters-filtergroup-changetype}}.\n\nThis indicates that no results will be shown.",
        "rcnotefrom": "This message is displayed at [[Special:RecentChanges]] when viewing recentchanges from some specific time.\n\nThe corresponding message is {{msg-mw|Rclistfrom}}.\n\nParameters:\n* $1 - the maximum number of changes that are displayed\n* $2 - (Optional) a date and time\n* $3 - a date\n* $4 - a time\n* $5 - Number of changes are displayed, for use with PLURAL",
        "rclistfrom": "Used on [[Special:RecentChanges]]. Parameters:\n* $1 - (Currently not use) date and time. The date and the time adds to the rclistfrom description.\n* $2 - time. The time adds to the rclistfrom link description (with split of date and time).\n* $3 - date. The date adds to the rclistfrom link description (with split of date and time).\n\nThe corresponding message is {{msg-mw|Rcnotefrom}}.",
+       "rclistfromreset": "Used on [[Special:RecentChanges]] to reset a selection of a certain date range.",
        "rcshowhideminor": "Option text in [[Special:RecentChanges]]. Parameters:\n* $1 - the \"show/hide\" command, with the text taken from either {{msg-mw|rcshowhideminor-show}} or {{msg-mw|rcshowhideminor-hide}}\n{{Identical|Minor edit}}",
        "rcshowhideminor-show": "{{doc-actionlink}}\nOption text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideminor}}.\n\nSee also:\n* {{msg-mw|rcshowhideminor-hide}}\n{{Identical|Show}}",
        "rcshowhideminor-hide": "{{doc-actionlink}}\nOption text in [[Special:RecentChanges]] in conjunction with {{msg-mw|rcshowhideminor}}.\n\nSee also:\n* {{msg-mw|rcshowhideminor-show}}\n{{Identical|Hide}}",