mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-01 22:02:11 +03:00
107ed0e1f3
refs https://github.com/TryGhost/Team/issues/947 - With email-only posts there's a new "send" status that deserved it's own publishing action in the post publish menu. With with addition the post ended up having few more publishing states: publish, send, and publish&send. In addition to all this there's a "schedule" option. An addition of the "send" only select option there became a need to persist the "email_only" flag when the option was changed in the publish menu. Such persistance was not done before from the publishing menu and led a whole chain of additional methods being passed down from publishmenu component all the way down to distribution-action-select component - At this moment only a happy path work properly when selecting one of the publishing options and publishing. More states will need to be handled for scheduled, unblished, etc. states of the post
65 lines
3.3 KiB
Handlebars
65 lines
3.3 KiB
Handlebars
<div {{did-insert (fn this.setSaveType "publish")}} ...attributes>
|
|
<header class="gh-publishmenu-heading">Ready to
|
|
{{#if this.showEmailOnlyInput}}
|
|
<GhDistributionActionSelect
|
|
@post={{@post}}
|
|
@setDistributionAction={{@setDistributionAction}}
|
|
/>
|
|
{{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")}}>
|
|
<div class="gh-publishmenu-radio-button" data-test-publishmenu-published-option></div>
|
|
<div class="gh-publishmenu-radio-content">
|
|
<div class="gh-publishmenu-radio-label">Set it live now</div>
|
|
<div class="gh-publishmenu-radio-desc">Publish this {{@post.displayName}} immediately</div>
|
|
</div>
|
|
</div>
|
|
<div class="gh-publishmenu-radio {{if (eq @saveType "schedule") "active"}}" {{on "click" (fn this.setSaveType "schedule")}}>
|
|
<div class="gh-publishmenu-radio-button" data-test-publishmenu-scheduled-option></div>
|
|
<div class="gh-publishmenu-radio-content">
|
|
<div class="gh-publishmenu-radio-label">Schedule it for later</div>
|
|
<GhDateTimePicker
|
|
@date={{@post.publishedAtBlogDate}}
|
|
@time={{@post.publishedAtBlogTime}}
|
|
@setDate={{this.setDate}}
|
|
@setTime={{this.setTime}}
|
|
@setTypedDateError={{@setTypedDateError}}
|
|
@errors={{@post.errors}}
|
|
@dateErrorProperty="publishedAtBlogDate"
|
|
@timeErrorProperty="publishedAtBlogTime"
|
|
@minDate={{this._minDate}}
|
|
@isActive={{eq @saveType "schedule"}}
|
|
/>
|
|
<div class="gh-publishmenu-radio-desc">Set automatic future publish date</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
{{#if this.showEmailSection}}
|
|
<div class="gh-publishmenu-section" {{did-insert (perform this.countTotalMembersTask)}}>
|
|
<div class="gh-publishmenu-email">
|
|
{{#if @isSendingEmailLimited}}
|
|
<p class="gh-box gh-box-alert">{{html-safe @sendingEmailLimitError}}</p>
|
|
{{else}}
|
|
<div class="gh-publishmenu-email-label {{if this.disableEmailOption "pe-none"}}">
|
|
<label class="gh-publishmenu-radio-label mb3 {{if this.disableEmailOption "midgrey"}}">Send by email to</label>
|
|
|
|
<div class="form-group">
|
|
<GhMembersRecipientSelect
|
|
@filter={{@recipientsFilter}}
|
|
@onChange={{@setSendEmailWhenPublished}}
|
|
@disabled={{this.disableEmailOption}}
|
|
/>
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
</div>
|
|
</div>
|
|
{{/if}}
|
|
</section>
|
|
</div> |