0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-24 23:48:13 -05:00

Integrated post distribution dropdown into publish menu

refs https://github.com/TryGhost/Team/issues/947

- Shows the publish option selector based on the "emailOnlyPosts" feature status
This commit is contained in:
Naz 2021-08-24 17:20:51 +04:00 committed by naz
parent 9e84441e75
commit eef3ee8942
2 changed files with 19 additions and 2 deletions

View file

@ -1,5 +1,14 @@
<div {{did-insert (fn this.setSaveType "publish")}} ...attributes>
<header class="gh-publishmenu-heading">Ready to {{this.nextActionName}} this {{@post.displayName}}?</header>
<header class="gh-publishmenu-heading">Ready to
{{#if this.showEmailOnlyInput}}
<GhDistributionActionSelect
@post={{@post}}
/>
{{else}}
{{this.nextActionName}}
{{/if}}
this {{@post.displayName}}?
</header>
<section class="gh-publishmenu-content">
<div class="gh-publishmenu-section">
<div class="gh-publishmenu-radio {{if (eq @saveType "publish") "active"}}" {{on "click" (fn this.setSaveType "publish")}}>
@ -30,7 +39,7 @@
</div>
</div>
{{#if @canSendEmail}}
{{#if this.showEmailSection}}
<div class="gh-publishmenu-section" {{did-insert (perform this.countTotalMembersTask)}}>
<div class="gh-publishmenu-email">
{{#if @isSendingEmailLimited}}

View file

@ -28,6 +28,14 @@ export default class GhPublishMenuDraftComponent extends Component {
return this.args.post.get('emailOnly') ? 'send' : 'publish';
}
get showEmailSection() {
return this.args.canSendEmail && this.args.post.get('emailRecipientFilter') !== 'none';
}
get showEmailOnlyInput() {
return this.feature.get('emailOnlyPosts') && this.args.post.get('isPost');
}
constructor() {
super(...arguments);
this.args.post.set('publishedAtBlogTZ', this.args.post.publishedAtUTC);