2 <cdx-field :is-fieldset="true">
4 v-model="createAccount"
5 input-value="wpCreateAccount"
7 {{ $i18n( 'ipbcreateaccount' ) }}
10 v-if="disableEmailVisible"
11 v-model="disableEmail"
12 input-value="wpDisableEmail"
14 {{ $i18n( 'ipbemailban' ) }}
17 v-if="disableUTEditVisible"
18 v-model="disableUTEdit"
19 input-value="wpDisableUTEdit"
21 {{ $i18n( 'ipb-disableusertalk' ) }}
24 {{ $i18n( 'block-details' ).text() }}
25 <span class="cdx-label__label__optional-flag">
26 {{ $i18n( 'htmlform-optional-flag' ).text() }}
29 <template #description>
30 {{ $i18n( 'block-details-description' ).text() }}
36 const { computed, defineComponent } = require( 'vue' );
37 const { storeToRefs } = require( 'pinia' );
38 const { CdxCheckbox, CdxField } = require( '@wikimedia/codex' );
39 const useBlockStore = require( '../stores/block.js' );
41 module.exports = exports = defineComponent( {
42 name: 'BlockDetailsField',
43 components: { CdxCheckbox, CdxField },
45 const store = useBlockStore();
46 const { createAccount, disableEmail, disableUTEdit } = storeToRefs( store );
47 const disableEmailVisible = mw.config.get( 'blockDisableEmailVisible' ) || false;
48 const disableUTEditVisible = computed( () => {
49 const isVisible = mw.config.get( 'blockDisableUTEditVisible' ) || false;
50 const isPartial = store.type === 'partial';
51 const blocksUT = store.namespaces.indexOf( mw.config.get( 'wgNamespaceIds' ).user_talk ) !== -1;
52 return isVisible && ( !isPartial || ( isPartial && blocksUT ) );