2021-08-26 21:45:11 +03:00
|
|
|
{{#if (eq this.displayState "sent")}}
|
2021-09-28 16:49:50 +03:00
|
|
|
<div class="gh-btn gh-btn-text sent">Sent</div>
|
2021-08-26 21:45:11 +03:00
|
|
|
{{else}}
|
2021-06-28 17:27:58 +03:00
|
|
|
<GhBasicDropdown @verticalPosition="below" @horizontalPosition="right" @onOpen={{action "open"}} @onClose={{action "close"}} as |dd|>
|
2021-03-04 13:53:31 +03:00
|
|
|
<dd.Trigger class="gh-btn gh-btn-editor {{if (or (eq this.displayState "published") (eq this.displayState "scheduled") (eq this.uiContext "preview")) "green"}} gh-publishmenu-trigger">
|
2019-11-21 02:23:23 +03:00
|
|
|
<span data-test-publishmenu-trigger>{{this.triggerText}} {{svg-jar "arrow-down"}}</span>
|
2020-01-15 16:53:51 +03:00
|
|
|
</dd.Trigger>
|
2017-04-11 16:39:45 +03:00
|
|
|
|
2020-01-15 16:53:51 +03:00
|
|
|
<dd.Content class="gh-publishmenu-dropdown">
|
2019-12-13 17:20:29 +03:00
|
|
|
{{#if (eq this.displayState "published")}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhPublishmenuPublished
|
|
|
|
@post={{this.post}}
|
|
|
|
@saveType={{this.saveType}}
|
2021-07-09 00:44:52 +03:00
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
data-test-publishmenu-published="true" />
|
2017-04-11 16:39:45 +03:00
|
|
|
|
2019-12-13 17:20:29 +03:00
|
|
|
{{else if (eq this.displayState "scheduled")}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhPublishmenuScheduled
|
|
|
|
@post={{this.post}}
|
|
|
|
@saveType={{this.saveType}}
|
2022-03-31 19:10:49 +03:00
|
|
|
@emailOnly={{this.emailOnly}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@isClosing={{this.isClosing}}
|
2021-05-07 12:02:19 +03:00
|
|
|
@canSendEmail={{this.canSendEmail}}
|
2021-05-21 20:22:01 +03:00
|
|
|
@recipientsFilter={{this.sendEmailWhenPublished}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@setSaveType={{action "setSaveType"}}
|
2021-05-04 20:46:22 +03:00
|
|
|
@setTypedDateError={{action (mut this.typedDateError)}}
|
|
|
|
@isSendingEmailLimited={{this.isSendingEmailLimited}}
|
2021-07-09 00:44:52 +03:00
|
|
|
@sendingEmailLimitError={{this.sendingEmailLimitError}}
|
2022-04-27 12:49:55 +03:00
|
|
|
@availableNewsletters={{this.availableNewsletters}}
|
2021-07-09 00:44:52 +03:00
|
|
|
data-test-publishmenu-scheduled="true" />
|
2017-04-11 16:39:45 +03:00
|
|
|
|
|
|
|
{{else}}
|
2020-01-16 18:14:03 +03:00
|
|
|
<GhPublishmenuDraft
|
|
|
|
@post={{this.post}}
|
|
|
|
@saveType={{this.saveType}}
|
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
@setTypedDateError={{action (mut this.typedDateError)}}
|
2021-05-07 12:02:19 +03:00
|
|
|
@canSendEmail={{this.canSendEmail}}
|
2021-10-15 17:42:32 +03:00
|
|
|
@emailOnly={{this.emailOnly}}
|
2021-05-21 20:22:01 +03:00
|
|
|
@recipientsFilter={{this.sendEmailWhenPublished}}
|
2020-11-06 21:54:27 +03:00
|
|
|
@setSendEmailWhenPublished={{action "setSendEmailWhenPublished"}}
|
2021-05-04 20:46:22 +03:00
|
|
|
@isSendingEmailLimited={{this.isSendingEmailLimited}}
|
2021-07-09 00:44:52 +03:00
|
|
|
@sendingEmailLimitError={{this.sendingEmailLimitError}}
|
2021-10-21 15:07:56 +03:00
|
|
|
@distributionAction={{this.distributionAction}}
|
2021-08-26 22:01:26 +03:00
|
|
|
@setDistributionAction={{action "setDistributionAction"}}
|
2022-04-06 12:22:00 +03:00
|
|
|
@availableNewsletters={{this.availableNewsletters}}
|
|
|
|
@selectedNewsletter={{this.selectedNewsletter}}
|
|
|
|
@selectNewsletter={{this.selectNewsletter}}
|
2021-07-09 00:44:52 +03:00
|
|
|
data-test-publishmenu-draft="true" />
|
2017-04-11 16:39:45 +03:00
|
|
|
{{/if}}
|
|
|
|
|
|
|
|
{{!--
|
|
|
|
save button needs to be outside of menu components so it doesn't lose state
|
|
|
|
or cancel the task when the post status updates and switches components
|
|
|
|
--}}
|
|
|
|
<footer class="gh-publishmenu-footer">
|
2022-02-02 19:09:43 +03:00
|
|
|
<button class="gh-btn gh-btn-outline" data-test-publishmenu-cancel type="button" {{on "click" (action dd.actions.close)}}>
|
2017-04-11 16:39:45 +03:00
|
|
|
<span>Cancel</span>
|
|
|
|
</button>
|
2019-11-21 02:23:23 +03:00
|
|
|
<GhTaskButton
|
|
|
|
@buttonText={{this.buttonText}}
|
|
|
|
@task={{this.save}}
|
|
|
|
@taskArgs={{hash dropdown=dd}}
|
|
|
|
@successText={{this.successText}}
|
|
|
|
@runningText={{this.runningText}}
|
2021-02-08 12:13:26 +03:00
|
|
|
@class="gh-btn gh-btn-black gh-publishmenu-button gh-btn-icon"
|
2021-07-09 00:44:52 +03:00
|
|
|
data-test-publishmenu-save="true"
|
2019-11-21 02:23:23 +03:00
|
|
|
/>
|
2017-04-11 16:39:45 +03:00
|
|
|
</footer>
|
2020-01-15 16:53:51 +03:00
|
|
|
</dd.Content>
|
2021-02-12 12:47:46 +03:00
|
|
|
</GhBasicDropdown>
|
2021-08-26 21:45:11 +03:00
|
|
|
{{/if}}
|
2019-11-07 11:37:26 +03:00
|
|
|
|
2021-12-01 14:50:51 +03:00
|
|
|
{{!--
|
|
|
|
Workaround to have an always-shown element to attach key handlers to.
|
|
|
|
TODO: Move onto main element once converted to a glimmer component
|
|
|
|
--}}
|
|
|
|
<div class="hidden" {{on-key "cmd+shift+p" (action "publishFromShortcut")}}></div>
|