diff options
Diffstat (limited to 'src/components/settings_modal/helpers')
4 files changed, 46 insertions, 3 deletions
diff --git a/src/components/settings_modal/helpers/boolean_setting.vue b/src/components/settings_modal/helpers/boolean_setting.vue index 7e05fe85..aedbf23e 100644 --- a/src/components/settings_modal/helpers/boolean_setting.vue +++ b/src/components/settings_modal/helpers/boolean_setting.vue @@ -12,7 +12,12 @@ v-if="!!$slots.default" class="label" > - <slot /> + <template v-if="backendDescription"> + {{ backendDescriptionLabel + ' ' }} + </template> + <template v-else> + <slot /> + </template> </span> {{ ' ' }} <ModifiedIndicator @@ -21,6 +26,12 @@ /> <ProfileSettingIndicator :is-profile="isProfileSetting" /> <DraftButtons /> + <p + v-if="backendDescriptionDescription" + class="setting-description" + > + {{ backendDescriptionDescription + ' ' }} + </p> </Checkbox> </label> </template> diff --git a/src/components/settings_modal/helpers/integer_setting.vue b/src/components/settings_modal/helpers/integer_setting.vue index e900b87c..e935dfb0 100644 --- a/src/components/settings_modal/helpers/integer_setting.vue +++ b/src/components/settings_modal/helpers/integer_setting.vue @@ -4,7 +4,12 @@ class="IntegerSetting" > <label :for="path"> - <slot /> + <template v-if="backendDescription"> + {{ backendDescriptionLabel + ' ' }} + </template> + <template v-else> + <slot /> + </template> </label> <input :id="path" @@ -23,6 +28,12 @@ /> <ProfileSettingIndicator :is-profile="isProfileSetting" /> <DraftButtons /> + <p + v-if="backendDescriptionDescription" + class="setting-description" + > + {{ backendDescriptionDescription + ' ' }} + </p> </span> </template> diff --git a/src/components/settings_modal/helpers/setting.js b/src/components/settings_modal/helpers/setting.js index 0971b919..f270216f 100644 --- a/src/components/settings_modal/helpers/setting.js +++ b/src/components/settings_modal/helpers/setting.js @@ -59,6 +59,16 @@ export default { return value } }, + backendDescription () { + console.log(get(this.$store.state.adminSettings.descriptions, this.path)) + return get(this.$store.state.adminSettings.descriptions, this.path) + }, + backendDescriptionLabel () { + return this.backendDescription.label + }, + backendDescriptionDescription () { + return this.backendDescription.description + }, shouldBeDisabled () { const parentValue = this.parentPath !== undefined ? get(this.configSource, this.parentPath) : null return this.disabled || (parentValue !== null ? (this.parentInvert ? parentValue : !parentValue) : false) diff --git a/src/components/settings_modal/helpers/string_setting.vue b/src/components/settings_modal/helpers/string_setting.vue index 0a71aeab..91a4afa4 100644 --- a/src/components/settings_modal/helpers/string_setting.vue +++ b/src/components/settings_modal/helpers/string_setting.vue @@ -4,7 +4,12 @@ class="StringSetting" > <label :for="path"> - <slot /> + <template v-if="backendDescription"> + {{ backendDescriptionLabel + ' ' }} + </template> + <template v-else> + <slot /> + </template> </label> <input :id="path" @@ -21,6 +26,12 @@ /> <ProfileSettingIndicator :is-profile="isProfileSetting" /> <DraftButtons /> + <p + v-if="backendDescriptionDescription" + class="setting-description" + > + {{ backendDescriptionDescription + ' ' }} + </p> </label> </template> |
