Skip to content

Commit 93c0634

Browse files
committed
add checkbox help
1 parent 32b2f44 commit 93c0634

4 files changed

Lines changed: 41 additions & 12 deletions

File tree

modules/@apostrophecms/i18n/i18n/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"at": "at",
4747
"attachment": "Attachment",
4848
"automaticTranslationCheckbox": "Translate text content",
49+
"automaticTranslationCheckboxHelp": "",
4950
"automaticTranslationDisclaimer": "",
5051
"automaticTranslationErrMsg": "An error happened while getting available languages for translation. Translation will be skipped.",
5152
"automaticTranslationErrorNoProvider": "Translation provider not found. Page \"{{ title }}\" was not translated.",

modules/@apostrophecms/i18n/ui/apos/components/AposI18nLocalize.vue

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,15 +231,19 @@
231231
{{ $t('apostrophe:automaticTranslationSettings') }}
232232
</span>
233233
</p>
234-
<p v-if="automaticTranslationDisclaimer" class="apos-wizard__translation-disclaimer">
234+
<p
235+
v-if="automaticTranslationDisclaimer"
236+
class="apos-wizard__translation-disclaimer"
237+
>
235238
{{ automaticTranslationDisclaimer }}
236239
</p>
237240
<AposCheckbox
238241
v-model="wizard.values.translateContent.data"
239242
:field="{ name: 'translate' }"
240243
:choice="{
241244
value: wizard.values.translateContent.data,
242-
label: $t('apostrophe:automaticTranslationCheckbox')
245+
label: $t('apostrophe:automaticTranslationCheckbox'),
246+
htmlHelp: $t('apostrophe:automaticTranslationCheckboxHelp')
243247
}"
244248
data-apos-test="localizationTranslationCheck"
245249
/>

modules/@apostrophecms/submitted-draft/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ module.exports = {
7979
},
8080
modal: {
8181
default: {
82-
'@apostrophecms/command-menu:taskbar-manager': {
82+
'@apostrophecms/command-menu:taskbar': {
8383
label: 'apostrophe:commandMenuTaskbar',
8484
commands: [
8585
`${self.__meta.name}:taskbar-manager`

modules/@apostrophecms/ui/ui/apos/components/AposCheckbox.vue

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,21 @@
3030
:size="10"
3131
/>
3232
</span>
33-
<span
34-
v-if="choice.label"
35-
:class="{'apos-sr-only': field.hideLabel }"
36-
class="apos-choice-label-text"
37-
>
38-
{{ $t(choice.label) }}
39-
</span>
33+
<div class="apos-choice-label">
34+
<span
35+
v-if="choice.label"
36+
:class="{'apos-sr-only': field.hideLabel }"
37+
class="apos-choice-label-text"
38+
>
39+
{{ $t(choice.label) }}
40+
</span>
41+
<!-- eslint-disable vue/no-v-html -->
42+
<p
43+
v-if="(choice.help || choice.htmlHelp)"
44+
class="apos-choice-label-help apos-field__help"
45+
v-html="$t(choice.help || choice.htmlHelp)"
46+
/>
47+
</div>
4048
</label>
4149
</template>
4250

@@ -104,7 +112,23 @@ export default {
104112
</script>
105113

106114
<style lang="scss" scoped>
107-
.apos-input-indicator {
108-
border-radius: 3px;
115+
.apos-input-indicator {
116+
border-radius: 3px;
117+
}
118+
119+
.apos-choice-label {
120+
display: inline-flex;
121+
flex-direction: column;
122+
align-items: baseline;
123+
}
124+
125+
.apos-field__help {
126+
@include type-base;
127+
128+
& {
129+
margin: 0 0 $spacing-base;
130+
line-height: var(--a-line-tall);
131+
color: var(--a-base-3);
109132
}
133+
}
110134
</style>

0 commit comments

Comments
 (0)