mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 13:54:35 +03:00
51536fb2ef
no issue - add icon + icon color to the subscription access and default post access option lists - updated templates to use icon in trigger and option display - fixed ember-power-select styles overriding svgs in trigger
43 lines
1.3 KiB
JavaScript
43 lines
1.3 KiB
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
|
|
export default class SettingsMembersSubscriptionAccess extends Component {
|
|
@service settings;
|
|
|
|
get options() {
|
|
return [{
|
|
name: 'Anyone can sign up',
|
|
description: 'All visitors will be able to subscribe and sign in',
|
|
value: 'all',
|
|
icon: 'globe',
|
|
icon_color: 'green'
|
|
}, {
|
|
name: 'Only people I invite',
|
|
description: 'People can sign in from your site but won\'t be able to sign up',
|
|
value: 'invite',
|
|
icon: 'globe',
|
|
icon_color: 'green'
|
|
}, {
|
|
name: 'Nobody',
|
|
description: 'No one will be able to subscribe or sign in',
|
|
value: 'none',
|
|
icon: 'globe',
|
|
icon_color: 'green'
|
|
}];
|
|
}
|
|
|
|
get selectedOption() {
|
|
return this.options.find(o => o.value === this.settings.get('membersSignupAccess'));
|
|
}
|
|
|
|
@action
|
|
setSignupAccess(option) {
|
|
this.settings.set('membersSignupAccess', option.value);
|
|
|
|
if (option.value === 'none') {
|
|
this.settings.set('defaultContentVisibility', 'public');
|
|
}
|
|
}
|
|
}
|