From a8cbdd304a5699be864cc94492a415ee5366e1bc Mon Sep 17 00:00:00 2001 From: Jacson Passold Date: Tue, 28 Aug 2018 00:22:15 -0300 Subject: [PATCH] use allow comments instead of comment status in collection --- .../edition/collection-edition-form.vue | 16 ++++++++-------- .../components/edition/item-edition-form.vue | 12 ++++++------ src/admin/pages/singles/item-page.vue | 10 +++++----- 3 files changed, 19 insertions(+), 19 deletions(-) diff --git a/src/admin/components/edition/collection-edition-form.vue b/src/admin/components/edition/collection-edition-form.vue index 70ad0bdf2..9c0a1a58b 100644 --- a/src/admin/components/edition/collection-edition-form.vue +++ b/src/admin/components/edition/collection-edition-form.vue @@ -236,10 +236,10 @@ size="is-small" true-value="open" false-value="closed" - v-model="form.comment_status" /> + v-model="form.allow_comments" /> + :title="$i18n.getHelperTitle('collections', 'allow_comments')" + :message="$i18n.getHelperMessage('collections', 'allow_comments')"/>
@@ -440,7 +440,7 @@ export default { moderators_ids: [], enabled_view_modes: [], default_view_mode: [], - comment_status: '' + allow_comments: '' }, thumbnail: {}, cover: {}, @@ -543,7 +543,7 @@ export default { parent: this.form.parent, enabled_view_modes: this.form.enabled_view_modes, default_view_mode: this.form.default_view_mode, - comment_status: this.form.comment_status + allow_comments: this.form.allow_comments }; this.updateCollection(data).then(updatedCollection => { @@ -558,7 +558,7 @@ export default { this.form.enable_cover_page = this.collection.enable_cover_page; this.form.enabled_view_modes = this.collection.enabled_view_modes; this.form.default_view_mode = this.collection.default_view_mode; - this.form.comment_status = this.collection.comment_status; + this.form.allow_comments = this.collection.allow_comments; this.isLoading = false; this.formErrorMessage = ''; @@ -603,7 +603,7 @@ export default { this.form.default_view_mode = this.collection.default_view_mode; this.form.enabled_view_modes = []; this.moderators = []; - this.form.comment_status = this.collection.comment_status; + this.form.allow_comments = this.collection.allow_comments; // Pre-fill status with publish to incentivate it this.form.status = 'publish'; @@ -790,7 +790,7 @@ export default { this.form.default_view_mode = this.collection.default_view_mode; this.form.enabled_view_modes = JSON.parse(JSON.stringify(this.collection.enabled_view_modes)); this.moderators = JSON.parse(JSON.stringify(this.collection.moderators)); - this.form.comment_status = this.collection.comment_status; + this.form.allow_comments = this.collection.allow_comments; // Generates CoverPage from current cover_page_id info if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') { diff --git a/src/admin/components/edition/item-edition-form.vue b/src/admin/components/edition/item-edition-form.vue index 7d198aa83..036f3b027 100644 --- a/src/admin/components/edition/item-edition-form.vue +++ b/src/admin/components/edition/item-edition-form.vue @@ -254,7 +254,7 @@ + v-if="collectionAllowComments == 'open'"> { - this.collectionCommentStatus = collectionCommentStatus; + // Obtains if collection allow items comments + this.fetchCollectionAllowComments(this.collectionId).then((collectionAllowComments) => { + this.collectionAllowComments = collectionAllowComments; }); // Sets feedback variables diff --git a/src/admin/pages/singles/item-page.vue b/src/admin/pages/singles/item-page.vue index 2aaddeaa0..0cc3bc7d6 100644 --- a/src/admin/pages/singles/item-page.vue +++ b/src/admin/pages/singles/item-page.vue @@ -87,7 +87,7 @@ + v-if="collectionAllowComments == 'open'"> { - this.collectionCommentStatus = collectionCommentStatus; + this.fetchCollectionAllowComments(this.collectionId).then((collectionAllowComments) => { + this.collectionAllowComments = collectionAllowComments; }); }