Merge "SpecialWatchlist: Conditionally hide the namespace checkboxes"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 14 Mar 2019 17:39:18 +0000 (17:39 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 14 Mar 2019 17:39:18 +0000 (17:39 +0000)
1  2 
includes/specials/SpecialWatchlist.php

@@@ -63,6 -63,7 +63,7 @@@ class SpecialWatchlist extends ChangesL
                $this->addHelpLink( 'Help:Watching pages' );
                $output->addModuleStyles( [ 'mediawiki.special' ] );
                $output->addModules( [
+                       'mediawiki.special.recentchanges',
                        'mediawiki.special.watchlist',
                ] );
  
                $join_conds = array_merge(
                        [
                                'watchlist' => [
 -                                      'INNER JOIN',
 +                                      'JOIN',
                                        [
                                                'wl_user' => $user->getId(),
                                                'wl_namespace=rc_namespace',
                                'class' => 'namespaceselector',
                        ]
                ) . "\n";
-               $namespaceForm .= '<span class="mw-input-with-label">' . Xml::checkLabel(
+               $hidden = $opts['namespace'] === '' ? ' mw-input-hidden' : '';
+               $namespaceForm .= '<span class="mw-input-with-label' . $hidden . '">' . Xml::checkLabel(
                        $this->msg( 'invert' )->text(),
                        'invert',
                        'nsinvert',
                        $opts['invert'],
                        [ 'title' => $this->msg( 'tooltip-invert' )->text() ]
                ) . "</span>\n";
-               $namespaceForm .= '<span class="mw-input-with-label">' . Xml::checkLabel(
+               $namespaceForm .= '<span class="mw-input-with-label' . $hidden . '">' . Xml::checkLabel(
                        $this->msg( 'namespace_association' )->text(),
                        'associated',
                        'nsassociated',