2021-02-12 12:47:46 +03:00
|
|
|
<GhBasicDropdown @verticalPosition="below" @onOpen={{action "open"}} @onClose={{action "close"}} as |dd|>
|
2021-02-10 17:54:30 +03:00
|
|
|
<dd.Trigger class="gh-btn gh-btn-editor {{if (or (eq this.displayState "published") (eq this.displayState "scheduled")) "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}}
|
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
@backgroundTask={{this.backgroundTask}} />
|
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}}
|
|
|
|
@isClosing={{this.isClosing}}
|
|
|
|
@memberCount={{this.memberCount}}
|
2020-11-11 20:08:43 +03:00
|
|
|
@paidMemberCount={{this.paidMemberCount}}
|
|
|
|
@freeMemberCount={{this.freeMemberCount}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@setSaveType={{action "setSaveType"}}
|
|
|
|
@setTypedDateError={{action (mut this.typedDateError)}} />
|
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)}}
|
2020-11-06 21:54:27 +03:00
|
|
|
@setSendEmailWhenPublished={{action "setSendEmailWhenPublished"}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@backgroundTask={{this.backgroundTask}}
|
|
|
|
@memberCount={{this.memberCount}}
|
2020-11-11 20:08:43 +03:00
|
|
|
@paidMemberCount={{this.paidMemberCount}}
|
|
|
|
@freeMemberCount={{this.freeMemberCount}}
|
2020-01-16 18:14:03 +03:00
|
|
|
@sendEmailWhenPublished={{this.sendEmailWhenPublished}} />
|
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">
|
2021-02-08 12:13:26 +03:00
|
|
|
<button class="gh-btn gh-btn-outline" {{on "click" (action dd.actions.close)}} data-test-publishmenu-cancel>
|
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"
|
2019-11-21 02:23:23 +03:00
|
|
|
data-test-publishmenu-save=true
|
|
|
|
/>
|
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>
|
2019-11-07 11:37:26 +03:00
|
|
|
|
2019-11-21 02:23:23 +03:00
|
|
|
{{#if this.showEmailConfirmationModal}}
|
2019-11-07 11:37:26 +03:00
|
|
|
<GhFullscreenModal
|
|
|
|
@modal="confirm-email-send"
|
2019-11-13 13:17:00 +03:00
|
|
|
@model={{hash
|
2020-11-06 21:54:27 +03:00
|
|
|
sendEmailWhenPublished=this.sendEmailWhenPublished
|
2019-11-13 13:17:00 +03:00
|
|
|
memberCount=this.memberCount
|
|
|
|
isScheduled=(eq this.saveType "schedule")
|
|
|
|
paidOnly=(eq this.post.visibility "paid")
|
2019-11-22 18:09:48 +03:00
|
|
|
retryEmailSend=this.retryEmailSend
|
2019-11-13 13:17:00 +03:00
|
|
|
}}
|
2019-11-07 11:37:26 +03:00
|
|
|
@confirm={{this.confirmEmailSend}}
|
|
|
|
@close={{this.closeEmailConfirmationModal}}
|
|
|
|
@modifier="action wide"
|
|
|
|
/>
|
|
|
|
{{/if}}
|