Ghost/ghost/admin/app/components/settings/members-default-post-access.hbs
Rishabh Garg e493afdb16 Updated specific tier handling for default post access setting (#2246)
refs https://github.com/TryGhost/Team/issues/1071

Default content visibility for specific tiers is now stored across 2 settings - `tiers` on `default_content_visibility` and list of tier ids on `default_content_visibility_tiers` setting, which is consistent with pattern of storing visibility on posts. This change -

- updates visibility filter UI for default content visibility segment select
- cleans up common visibility segment select component to handle ids directly instead of nql segments
- updates setting model
2022-02-04 21:00:59 +05:30

43 lines
1.5 KiB
Handlebars

<div class="mb4 gh-setting-large-dropdown">
<div class="gh-expandable-header">
<div>
<h4 class="gh-expandable-title">Default post access</h4>
<p class="gh-expandable-description">When a new post is created, who should have access?</p>
</div>
</div>
<PowerSelect
@options={{this.options}}
@selected={{this.selectedOption}}
@onChange={{this.setDefaultContentVisibility}}
@disabled={{eq this.settings.membersSignupAccess "none"}}
@triggerClass="gh-setting-dropdown"
@dropdownClass="gh-setting-dropdown-list"
as |option|
>
<div class="gh-setting-dropdown-content">
{{svg-jar option.icon class=(concat "w8 h8 mr2 fill-" (or option.icon_color "green"))}}
<div class="gh-radio-label">
{{option.name}}<br>
<div class="gh-radio-desc">{{option.description}}</div>
</div>
</div>
</PowerSelect>
{{#if this.hasVisibilityFilter}}
<div class="mt2">
<GhPostSettingsMenu::VisibilitySegmentSelect
@selectDefaultProduct={{true}}
@tiers={{this.visibilityTiers}}
@onChange={{action "setVisibility"}}
@renderInPlace={{true}}
@hideOptionsWhenAllSelected={{true}}
/>
{{#if this.showSegmentError}}
<p class="response red">
Please select at least one tier
</p>
{{/if}}
</div>
{{/if}}
</div>