add alert variant option for FormField description

This commit is contained in:
Axolotle 2020-11-25 18:26:31 +01:00
parent 864945a2ac
commit 4dd44ec9d1
4 changed files with 8 additions and 3 deletions

View file

@ -35,7 +35,7 @@
</b-link>
</div>
<span v-if="description" v-html="description" />
<div v-if="description" v-html="description" :class="{ ['alert p-1 px-2 alert-' + descriptionVariant]: descriptionVariant }"/>
</template>
<!-- Slot available to overwrite the one above -->
<slot name="description" />
@ -53,6 +53,7 @@ export default {
// Component props (other <form-group> related attrs are passed thanks to $attrs)
id: { type: String, default: null },
description: { type: String, default: null },
descriptionVariant: { type: String, default: null },
example: { type: String, default: null },
link: { type: Object, default: null },
// Rendered field component props

View file

@ -397,8 +397,9 @@
"tools_shuttingdown": "Your server is powering off. As long as your server is off, you won't be able to use the web administration.",
"tools_shutdown_reboot": "Shutdown/Reboot",
"tools_webadmin": {
"locale": "Locale",
"fallback_locale": "Fallback locale",
"language": "Language",
"fallback_language": "Fallback language",
"fallback_language_description": "Language that will be used in case the translation is not available in the main language.",
"cache": "Cache",
"cache_description": "Consider disabling the cache if you plan on working with the CLI while also navigating in this web-admin.",
"experimental": "Experimental mode",

View file

@ -117,12 +117,14 @@ export default {
id: 'mail',
label: this.$i18n.t('user_email'),
description: this.$i18n.t('tip_about_user_email'),
descriptionVariant: 'info',
props: { choices: [] }
},
password: {
label: this.$i18n.t('password'),
description: this.$i18n.t('good_practices_about_user_password'),
descriptionVariant: 'warning',
props: {
id: 'password',
placeholder: '••••••••',

View file

@ -198,6 +198,7 @@ export default {
password: {
label: this.$i18n.t('password'),
description: this.$i18n.t('good_practices_about_user_password'),
descriptionVariant: 'warning',
props: { id: 'password', type: 'password', placeholder: '••••••••' }
},