protected $options;
+ protected $blockType;
+
function __construct() {
parent::__construct( 'BlockList' );
}
$this->outputHeader();
$out = $this->getOutput();
$out->setPageTitle( $this->msg( 'ipblocklist' ) );
- $out->addModuleStyles( [ 'mediawiki.special' ] );
+ $out->addModuleStyles( [ 'mediawiki.special', 'mediawiki.special.blocklist' ] );
$request = $this->getRequest();
$par = $request->getVal( 'ip', $par );
$this->target = trim( $request->getVal( 'wpTarget', $par ) );
$this->options = $request->getArray( 'wpOptions', [] );
+ $this->blockType = $request->getVal( 'blockType' );
$action = $request->getText( 'action' );
],
'flatlist' => true,
],
- 'Limit' => [
- 'type' => 'limitselect',
- 'label-message' => 'table_pager_limit_label',
- 'options' => $pager->getLimitSelectList(),
- 'name' => 'limit',
- 'default' => $pager->getLimit(),
- ],
];
+
+ if ( $this->getConfig()->get( 'EnablePartialBlocks' ) ) {
+ $fields['BlockType'] = [
+ 'type' => 'select',
+ 'label-message' => 'blocklist-type',
+ 'options' => [
+ $this->msg( 'blocklist-type-opt-all' )->escaped() => '',
+ $this->msg( 'blocklist-type-opt-sitewide' )->escaped() => 'sitewide',
+ $this->msg( 'blocklist-type-opt-partial' )->escaped() => 'partial',
+ ],
+ 'name' => 'blockType',
+ 'cssclass' => 'mw-field-block-type',
+ ];
+ }
+
+ $fields['Limit'] = [
+ 'type' => 'limitselect',
+ 'label-message' => 'table_pager_limit_label',
+ 'options' => $pager->getLimitSelectList(),
+ 'name' => 'limit',
+ 'default' => $pager->getLimit(),
+ 'cssclass' => $this->getConfig()->get( 'EnablePartialBlocks' ) ?
+ 'mw-field-limit mw-has-field-block-type' :
+ 'mw-field-limit',
+ ];
+
$context = new DerivativeContext( $this->getContext() );
$context->setTitle( $this->getPageTitle() ); // Remove subpage
$form = HTMLForm::factory( 'ooui', $fields, $context );
$conds[] = "ipb_range_end = ipb_range_start";
}
+ if ( $this->blockType === 'sitewide' ) {
+ $conds[] = 'ipb_sitewide = 1';
+ } elseif ( $this->blockType === 'partial' ) {
+ $conds[] = 'ipb_sitewide = 0';
+ }
+
return new BlockListPager( $this, $conds );
}
"blocklist-userblocks": "Hide account blocks",
"blocklist-tempblocks": "Hide temporary blocks",
"blocklist-addressblocks": "Hide single IP blocks",
+ "blocklist-type": "Type:",
+ "blocklist-type-opt-all": "All",
+ "blocklist-type-opt-sitewide": "Sitewide",
+ "blocklist-type-opt-partial": "Partial",
"blocklist-rangeblocks": "Hide range blocks",
"blocklist-timestamp": "Timestamp",
"blocklist-target": "Target",
"blocklist-editing-page": "pages",
"blocklist-editing-ns": "namespaces",
"ipblocklist-empty": "The block list is empty.",
- "ipblocklist-no-results": "The requested IP address or username is not blocked.",
+ "ipblocklist-no-results": "No matching blocks found for the requested IP address or username.",
"blocklink": "block",
"unblocklink": "unblock",
"change-blocklink": "change block",
"blocklist-userblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",
"blocklist-tempblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",
"blocklist-addressblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n{{Related|Blocklist-blocks}}",
+ "blocklist-type": "Used as label for dropdown box in [[Special:BlockList]].",
+ "blocklist-type-opt-all": "Used as option for dropdown box in [[Special:BlockList]]. This is the default option and indicates that \"all\" blocks will be listed",
+ "blocklist-type-opt-sitewide": "Used as option for dropdown box in [[Special:BlockList]]. This option indicates that only \"sitewide\" blocks will be listed.",
+ "blocklist-type-opt-partial": "Used as option for dropdown box in [[Special:BlockList]]. This option indicates that only \"partial\" blocks will be listed.",
"blocklist-rangeblocks": "Used as the label for the multi-select checkbox in the form on [[Special:BlockList]].\n\nFor an explanation of \"range blocks\", see [[mw:Help:Range_blocks]]\n{{Related|Blocklist-blocks}}",
"blocklist-timestamp": "This is a column header for dates and times in the table on the page [[Special:BlockList]].\n{{Identical|Timestamp}}",
"blocklist-target": "The table header for the column containing the block targets, that is user names or IP-addresses linked to their respective user pages, in the table on the page [[Special:BlockList]].\n{{Identical|Target}}",
],
'targets' => [ 'desktop', 'mobile' ],
],
+ 'mediawiki.special.blocklist' => [
+ 'styles' => 'resources/src/mediawiki.special/blocklist.less',
+ 'targets' => [ 'desktop', 'mobile' ],
+ ],
'mediawiki.special.changecredentials.js' => [
'scripts' => 'resources/src/mediawiki.special.changecredentials.js',
'dependencies' => [
--- /dev/null
+.mw-special-BlockList {
+ .oo-ui-fieldsetLayout-group {
+ max-width: 50em;
+ }
+
+ .oo-ui-layout {
+ &.mw-field-block-type,
+ &.mw-field-limit.mw-has-field-block-type {
+ display: inline-block;
+ width: 50%;
+ box-sizing: border-box;
+ margin-top: 0;
+ }
+
+ &.mw-field-block-type {
+ padding-right: 1em;
+ }
+ }
+}