use allow comments instead of comment status in collection
This commit is contained in:
parent
8910ad2ab8
commit
a8cbdd304a
|
@ -236,10 +236,10 @@
|
||||||
size="is-small"
|
size="is-small"
|
||||||
true-value="open"
|
true-value="open"
|
||||||
false-value="closed"
|
false-value="closed"
|
||||||
v-model="form.comment_status" />
|
v-model="form.allow_comments" />
|
||||||
<help-button
|
<help-button
|
||||||
:title="$i18n.getHelperTitle('collections', 'comment_status')"
|
:title="$i18n.getHelperTitle('collections', 'allow_comments')"
|
||||||
:message="$i18n.getHelperMessage('collections', 'comment_status')"/>
|
:message="$i18n.getHelperMessage('collections', 'allow_comments')"/>
|
||||||
</b-field>
|
</b-field>
|
||||||
</div>
|
</div>
|
||||||
<div class="column is-1" />
|
<div class="column is-1" />
|
||||||
|
@ -440,7 +440,7 @@ export default {
|
||||||
moderators_ids: [],
|
moderators_ids: [],
|
||||||
enabled_view_modes: [],
|
enabled_view_modes: [],
|
||||||
default_view_mode: [],
|
default_view_mode: [],
|
||||||
comment_status: ''
|
allow_comments: ''
|
||||||
},
|
},
|
||||||
thumbnail: {},
|
thumbnail: {},
|
||||||
cover: {},
|
cover: {},
|
||||||
|
@ -543,7 +543,7 @@ export default {
|
||||||
parent: this.form.parent,
|
parent: this.form.parent,
|
||||||
enabled_view_modes: this.form.enabled_view_modes,
|
enabled_view_modes: this.form.enabled_view_modes,
|
||||||
default_view_mode: this.form.default_view_mode,
|
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 => {
|
this.updateCollection(data).then(updatedCollection => {
|
||||||
|
|
||||||
|
@ -558,7 +558,7 @@ export default {
|
||||||
this.form.enable_cover_page = this.collection.enable_cover_page;
|
this.form.enable_cover_page = this.collection.enable_cover_page;
|
||||||
this.form.enabled_view_modes = this.collection.enabled_view_modes;
|
this.form.enabled_view_modes = this.collection.enabled_view_modes;
|
||||||
this.form.default_view_mode = this.collection.default_view_mode;
|
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.isLoading = false;
|
||||||
this.formErrorMessage = '';
|
this.formErrorMessage = '';
|
||||||
|
@ -603,7 +603,7 @@ export default {
|
||||||
this.form.default_view_mode = this.collection.default_view_mode;
|
this.form.default_view_mode = this.collection.default_view_mode;
|
||||||
this.form.enabled_view_modes = [];
|
this.form.enabled_view_modes = [];
|
||||||
this.moderators = [];
|
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
|
// Pre-fill status with publish to incentivate it
|
||||||
this.form.status = 'publish';
|
this.form.status = 'publish';
|
||||||
|
@ -790,7 +790,7 @@ export default {
|
||||||
this.form.default_view_mode = this.collection.default_view_mode;
|
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.form.enabled_view_modes = JSON.parse(JSON.stringify(this.collection.enabled_view_modes));
|
||||||
this.moderators = JSON.parse(JSON.stringify(this.collection.moderators));
|
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
|
// Generates CoverPage from current cover_page_id info
|
||||||
if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') {
|
if (this.form.cover_page_id != undefined && this.form.cover_page_id != '') {
|
||||||
|
|
|
@ -254,7 +254,7 @@
|
||||||
<b-field
|
<b-field
|
||||||
:addons="false"
|
:addons="false"
|
||||||
:label="$i18n.get('label_comment_status')"
|
:label="$i18n.get('label_comment_status')"
|
||||||
v-if="collectionCommentStatus == 'open'">
|
v-if="collectionAllowComments == 'open'">
|
||||||
<b-switch
|
<b-switch
|
||||||
id="tainacan-checkbox-comment-status"
|
id="tainacan-checkbox-comment-status"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
|
@ -485,7 +485,7 @@ export default {
|
||||||
textLink: '',
|
textLink: '',
|
||||||
isUpdatingValues: false,
|
isUpdatingValues: false,
|
||||||
collectionName: '',
|
collectionName: '',
|
||||||
collectionCommentStatus: ''
|
collectionAllowComments: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
@ -524,7 +524,7 @@ export default {
|
||||||
]),
|
]),
|
||||||
...mapActions('collection', [
|
...mapActions('collection', [
|
||||||
'fetchCollectionName',
|
'fetchCollectionName',
|
||||||
'fetchCollectionCommentStatus',
|
'fetchCollectionAllowComments',
|
||||||
'deleteItem',
|
'deleteItem',
|
||||||
]),
|
]),
|
||||||
onSubmit(status) {
|
onSubmit(status) {
|
||||||
|
@ -827,9 +827,9 @@ export default {
|
||||||
this.collectionName = collectionName;
|
this.collectionName = collectionName;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Obtains collection name
|
// Obtains if collection allow items comments
|
||||||
this.fetchCollectionCommentStatus(this.collectionId).then((collectionCommentStatus) => {
|
this.fetchCollectionAllowComments(this.collectionId).then((collectionAllowComments) => {
|
||||||
this.collectionCommentStatus = collectionCommentStatus;
|
this.collectionAllowComments = collectionAllowComments;
|
||||||
});
|
});
|
||||||
|
|
||||||
// Sets feedback variables
|
// Sets feedback variables
|
||||||
|
|
|
@ -87,7 +87,7 @@
|
||||||
<b-field
|
<b-field
|
||||||
:addons="false"
|
:addons="false"
|
||||||
:label="$i18n.get('label_comment_status')"
|
:label="$i18n.get('label_comment_status')"
|
||||||
v-if="collectionCommentStatus == 'open'">
|
v-if="collectionAllowComments == 'open'">
|
||||||
<b-switch
|
<b-switch
|
||||||
id="tainacan-checkbox-comment-status"
|
id="tainacan-checkbox-comment-status"
|
||||||
size="is-small"
|
size="is-small"
|
||||||
|
@ -271,7 +271,7 @@
|
||||||
collectionName: '',
|
collectionName: '',
|
||||||
thumbPlaceholderPath: tainacan_plugin.base_url + '/admin/images/placeholder_square.png',
|
thumbPlaceholderPath: tainacan_plugin.base_url + '/admin/images/placeholder_square.png',
|
||||||
urls_open: false,
|
urls_open: false,
|
||||||
collectionCommentStatus: ''
|
collectionAllowComments: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
|
@ -285,7 +285,7 @@
|
||||||
]),
|
]),
|
||||||
...mapActions('collection', [
|
...mapActions('collection', [
|
||||||
'fetchCollectionName',
|
'fetchCollectionName',
|
||||||
'fetchCollectionCommentStatus'
|
'fetchCollectionAllowComments'
|
||||||
]),
|
]),
|
||||||
...mapGetters('item', [
|
...mapGetters('item', [
|
||||||
'getItem',
|
'getItem',
|
||||||
|
@ -370,8 +370,8 @@
|
||||||
this.fetchAttachments(this.itemId);
|
this.fetchAttachments(this.itemId);
|
||||||
|
|
||||||
// Obtains collection Comment Status
|
// Obtains collection Comment Status
|
||||||
this.fetchCollectionCommentStatus(this.collectionId).then((collectionCommentStatus) => {
|
this.fetchCollectionAllowComments(this.collectionId).then((collectionAllowComments) => {
|
||||||
this.collectionCommentStatus = collectionCommentStatus;
|
this.collectionAllowComments = collectionAllowComments;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue