Ghost/ghost/admin/app/components/gh-psm-visibility-input.js
Naz Gargol cdb87e5112 Added PSM visibility input (#1344)
refs 80f7e0b19e

- Added visibility input in PSM to control content access level for members
- Added default post visibility in editor. To be changed (moved to server-side) once `defaultContentVisibility` is available in settings service
- Added `visibility` property to post model & mirage
2019-10-01 15:00:53 +02:00

25 lines
529 B
JavaScript

import Component from '@ember/component';
const VISIBILITIES = [
{label: 'Everyone', name: 'public'},
{label: 'Free and paying members', name: 'members'},
{label: 'Only paying members', name: 'paid'}
];
export default Component.extend({
// public attrs
post: null,
init() {
this._super(...arguments);
this.availableVisibilities = VISIBILITIES;
},
actions: {
updateVisibility(newVisibility) {
this.post.set('visibility', newVisibility);
}
}
});