From 5266de2c62ca451e18c5900fb87e64a32678a551 Mon Sep 17 00:00:00 2001 From: Matt Rider Date: Thu, 13 Jun 2019 17:29:33 -0300 Subject: [PATCH] Set dropdown with language of post if exists follow `PR` review by @Tirokk --- webapp/components/ContributionForm/index.vue | 6 +++++- webapp/pages/post/edit/_id.vue | 5 ++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/webapp/components/ContributionForm/index.vue b/webapp/components/ContributionForm/index.vue index 475ed60d8..cbaff79f3 100644 --- a/webapp/components/ContributionForm/index.vue +++ b/webapp/components/ContributionForm/index.vue @@ -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 } }, diff --git a/webapp/pages/post/edit/_id.vue b/webapp/pages/post/edit/_id.vue index 7dcff5036..150087ce2 100644 --- a/webapp/pages/post/edit/_id.vue +++ b/webapp/pages/post/edit/_id.vue @@ -3,9 +3,7 @@ - -   - +   @@ -49,6 +47,7 @@ export default { deleted slug image + language author { id disabled