Sbisson has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372536 )

Change subject: WLFilters: new 'watchist activity' filter group
......................................................................

WLFilters: new 'watchist activity' filter group

Bug: T171127
Change-Id: I84bf122bd042dd9b8b5495cb59a2a8f7cb77eb55
---
M includes/specials/SpecialWatchlist.php
M languages/i18n/en.json
M languages/i18n/qqq.json
3 files changed, 48 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core 
refs/changes/36/372536/1

diff --git a/includes/specials/SpecialWatchlist.php 
b/includes/specials/SpecialWatchlist.php
index 088bc1b..ae695c57 100644
--- a/includes/specials/SpecialWatchlist.php
+++ b/includes/specials/SpecialWatchlist.php
@@ -142,6 +142,43 @@
        protected function registerFilters() {
                parent::registerFilters();
 
+               $this->registerFilterGroup( new 
ChangesListStringOptionsFilterGroup( [
+                       'name' => 'watchlistactivity',
+                       'title' => 'rcfilters-filtergroup-watchlistactivity',
+                       'class' => ChangesListStringOptionsFilterGroup::class,
+                       'priority' => 3,
+                       'isFullCoverage' => true,
+                       'filters' => [
+                               [
+                                       'name' => 'unseen',
+                                       'label' => 
'rcfilters-filter-watchlistactivity-unseen-label',
+                                       'description' => 
'rcfilters-filter-watchlistactivity-unseen-description',
+                                       'cssClassSuffix' => 'watchedunseen',
+                                       'isRowApplicableCallable' => function ( 
$ctx, $rc ) {
+                                               return $rc->getAttribute( 
'rc_timestamp' ) >= $rc->getAttribute( 'wl_notificationtimestamp' );
+                                       },
+                               ],
+                               [
+                                       'name' => 'seen',
+                                       'label' => 
'rcfilters-filter-watchlistactivity-seen-label',
+                                       'description' => 
'rcfilters-filter-watchlistactivity-seen-description',
+                                       'cssClassSuffix' => 'watchedseen',
+                                       'isRowApplicableCallable' => function ( 
$ctx, $rc ) {
+                                               return $rc->getAttribute( 
'rc_timestamp' ) < $rc->getAttribute( 'wl_notificationtimestamp' );
+                                       }
+                               ],
+                       ],
+                       'default' => ChangesListStringOptionsFilterGroup::NONE,
+                       'queryCallable' => function ( $specialPageClassName, 
$context, $dbr,
+                                                                               
  &$tables, &$fields, &$conds, &$query_options, &$join_conds, $selectedValues ) 
{
+                               if ( $selectedValues === [ 'seen' ] ) {
+                                       $conds[] = 'rc_timestamp < 
wl_notificationtimestamp';
+                               } elseif ( $selectedValues === [ 'unseen' ] ) {
+                                       $conds[] = 'rc_timestamp >= 
wl_notificationtimestamp';
+                               }
+                       }
+               ] ) );
+
                $user = $this->getUser();
 
                $significance = $this->getFilterGroup( 'significance' );
diff --git a/languages/i18n/en.json b/languages/i18n/en.json
index 69b134a..6126bbd 100644
--- a/languages/i18n/en.json
+++ b/languages/i18n/en.json
@@ -1430,6 +1430,11 @@
        "rcfilters-filter-watchlist-watchednew-description": "Changes to 
Watchlisted pages you haven't visited since the changes occurred.",
        "rcfilters-filter-watchlist-notwatched-label": "Not on Watchlist",
        "rcfilters-filter-watchlist-notwatched-description": "Everything except 
changes to your Watchlisted pages.",
+       "rcfilters-filtergroup-watchlistactivity": "Watchlist activity",
+       "rcfilters-filter-watchlistactivity-unseen-label": "Unseen changes",
+       "rcfilters-filter-watchlistactivity-unseen-description": "Changes to 
pages you haven't visited since the changes occurred.",
+       "rcfilters-filter-watchlistactivity-seen-label": "Seen changes",
+       "rcfilters-filter-watchlistactivity-seen-description": "Changes to 
pages you have visited since the changes occurred.",
        "rcfilters-filtergroup-changetype": "Type of change",
        "rcfilters-filter-pageedits-label": "Page edits",
        "rcfilters-filter-pageedits-description": "Edits to wiki content, 
discussions, category descriptions…",
diff --git a/languages/i18n/qqq.json b/languages/i18n/qqq.json
index 20b0182..bc0fe2c 100644
--- a/languages/i18n/qqq.json
+++ b/languages/i18n/qqq.json
@@ -1613,13 +1613,18 @@
        "rcfilters-filter-minor-description": "Description for the filter for 
showing edits marked as minor.",
        "rcfilters-filter-major-label": "Label for the filter for showing edits 
not marked as minor.",
        "rcfilters-filter-major-description": " Description for the filter for 
showing edits not marked as minor.",
-       "rcfilters-filtergroup-watchlist": "Title for the watchlist filter 
group",
+       "rcfilters-filtergroup-watchlist": "Title for the watchlist filter 
group (only available on [[Special:Recentchanges]])",
        "rcfilters-filter-watchlist-watched-label": "Label for the filter for 
showing changes to pages on your watchlist.",
        "rcfilters-filter-watchlist-watched-description": "Description for the 
filter for showing changes to pages on your watchlist.",
        "rcfilters-filter-watchlist-watchednew-label": "Label for the filter 
for showing new changes to pages on your watchlist.",
        "rcfilters-filter-watchlist-watchednew-description": "Description for 
the filter for showing new changes to pages on your watchlist.",
        "rcfilters-filter-watchlist-notwatched-label": "Label for the filter 
for showing changes to pages not on your watchlist.",
        "rcfilters-filter-watchlist-notwatched-description": "Description for 
the filter for showing changes to pages not on your watchlist.",
+       "rcfilters-filtergroup-watchlistactivity": "Title for the watchlist 
activity filter group (only available on [[Special:Watchlist]])",
+       "rcfilters-filter-watchlistactivity-unseen-label": "Label for unseen 
changes in the watchlist activity filter group.",
+       "rcfilters-filter-watchlistactivity-unseen-description": "Description 
for unseen changes in the watchlist activity filter group.",
+       "rcfilters-filter-watchlistactivity-seen-label": "Label for seen 
changes in the watchlist activity filter group.",
+       "rcfilters-filter-watchlistactivity-seen-description": "Description for 
seen changes in the watchlist activity filter group.",
        "rcfilters-filtergroup-changetype": "Title for the filter group for 
edit type.",
        "rcfilters-filter-pageedits-label": "Label for the filter for showing 
edits to existing pages.",
        "rcfilters-filter-pageedits-description": "Description for the filter 
for showing edits to existing pages.",

-- 
To view, visit https://gerrit.wikimedia.org/r/372536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I84bf122bd042dd9b8b5495cb59a2a8f7cb77eb55
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Sbisson <sbis...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to