Set dropdown with language of post if exists

follow `PR` review by @Tirokk
This commit is contained in:
Matt Rider 2019-06-13 17:29:33 -03:00
parent 3ab69b5fde
commit 5266de2c62
2 changed files with 7 additions and 4 deletions

View File

@ -87,6 +87,7 @@ export default {
this.slug = contribution.slug
this.form.content = contribution.content
this.form.title = contribution.title
this.form.language = this.locale
},
},
},
@ -137,7 +138,10 @@ export default {
this.$refs.contributionForm.update('content', value)
},
returnLocaleName(locale) {
if (this.$i18n.locale() === locale.code) {
if (
this.contribution.language === locale.code ||
(!this.contribution.language && this.$i18n.locale() === locale.code)
) {
return locale
}
},

View File

@ -3,9 +3,7 @@
<ds-flex-item :width="{ base: '100%', md: 3 }">
<hc-contribution-form :contribution="contribution" />
</ds-flex-item>
<ds-flex-item :width="{ base: '100%', md: 1 }">
&nbsp;
</ds-flex-item>
<ds-flex-item :width="{ base: '100%', md: 1 }">&nbsp;</ds-flex-item>
</ds-flex>
</template>
@ -49,6 +47,7 @@ export default {
deleted
slug
image
language
author {
id
disabled