2 <cdx-field :is-fieldset="true">
4 {{ $i18n( 'block-actions' ).text() }}
7 v-for="radio in typeCheckboxes"
8 :key="'radio-' + radio.value"
10 name="wpEditingRestriction"
11 :input-value="radio.value"
14 <template #description>
15 <span v-i18n-html="radio.descriptionMsg"></span>
19 v-if="type === 'partial'"
20 class="mw-block-partial-options"
22 <pages-field></pages-field>
23 <namespaces-field></namespaces-field>
25 <cdx-field :is-fieldset="true">
27 v-for="checkbox in partialBlockCheckboxes"
28 :key="'checkbox-' + checkbox.value"
29 v-model="partialOptions"
30 :input-value="checkbox.value"
40 const { defineComponent } = require( 'vue' );
41 const { CdxCheckbox, CdxRadio, CdxField } = require( '@wikimedia/codex' );
42 const { storeToRefs } = require( 'pinia' );
43 const useBlockStore = require( '../stores/block.js' );
44 const PagesField = require( './PagesField.vue' );
45 const NamespacesField = require( './NamespacesField.vue' );
47 module.exports = exports = defineComponent( {
48 name: 'BlockTypeField',
57 const { type, partialOptions } = storeToRefs( useBlockStore() );
59 const typeCheckboxes = [
61 label: mw.message( 'blocklist-type-opt-sitewide' ),
62 descriptionMsg: 'ipb-sitewide-help',
66 label: mw.message( 'blocklist-type-opt-partial' ),
67 descriptionMsg: 'ipb-partial-help',
72 const partialBlockCheckboxes = mw.config.get( 'partialBlockActionOptions' ) ?
73 Object.keys( mw.config.get( 'partialBlockActionOptions' ) ).map(
74 // Messages that can be used here:
75 // * ipb-action-upload
77 // * ipb-action-create
78 ( key ) => Object( { label: mw.message( key ).text(), value: key } ) ) :
85 partialBlockCheckboxes
92 @import 'mediawiki.skin.variables.less';
95 margin-top: @spacing-100;
98 .mw-block-partial-options {
99 padding-left: calc( @size-125 + @spacing-50 );
101 .cdx-label__label__text {
102 font-weight: @font-weight-normal;