Ghost/ghost/admin/app/components/editor/modals/publish-flow/complete.hbs
Kevin Ansfield 3f0e46c7b0 Added initial tests for new publish flow
refs https://github.com/TryGhost/Team/issues/1586

- added test helper for enabling/disabling members and helpers for disabling mailgun and newsletters
- added `loginAsRole` helper that alleviates duplication of user+role creation and also handles log-out before log-in so it's easier to mix different role tests within a block that has a default role setup in `beforeEach()`
- cleaned up editor tests that were skipped due to using the old publish flow
- added `Publish flow` acceptance test suite with an initial batch of tests
2022-05-30 19:12:16 +01:00

112 lines
4.0 KiB
Handlebars
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{#let @publishOptions.post as |post|}}
<div class="gh-publish-title" data-test-publish-flow="complete" data-test-complete-title>
{{#if post.isScheduled}}
<span class="green">All set!</span>
Your {{if post.emailOnly "email" post.displayName}} will be
{{#if post.emailOnly}}
sent
{{else if post.willEmail}}
published and sent
{{else}}
published
{{/if}}
{{#let (moment-site-tz post.publishedAtUTC) as |scheduledAt|}}
{{#if (is-moment-today scheduledAt)}}
today
{{else}}
on {{moment-format scheduledAt "MMMM Do"}}
{{/if}}
at {{moment-format scheduledAt "HH:mm"}}.
{{/let}}
{{else}}
<span class="green">Boom. Its out there.</span>
{{#if post.emailOnly}}
Your email has been sent.
{{else if (and post.isPost @postCount)}}
Thats {{gh-pluralize @postCount "post"}} published, keep going!
{{else}}
Your {{post.displayName}} has been published.
{{/if}}
{{/if}}
</div>
{{#if post.emailOnly}}
<div class="gh-publish-confirmation" data-test-complete->
<p>
Your post
{{if post.isScheduled "will be" "was"}}
sent to
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
<strong>
{{if (eq @recipientType "all") "all"}}
{{countFetcher.count}}
{{!-- @recipientType = free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
</strong>
{{#unless @publishOptions.onlyDefaultNewsletter}}
of <strong>{{@publishOptions.newsletter.name}}</strong>{{if post.isScheduled "," "."}}
{{/unless}}
{{/let}}
{{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}}
on
{{moment-format publishedAt "D MMM YYYY"}}
at
{{moment-format publishedAt "HH:mm"}}.
{{/let}}
</p>
{{#if post.isScheduled}}
<p>
Need to make a change?
<button
type="button"
class="gh-revert-to-draft"
{{on "click" (fn @close (hash afterTask="revertToDraftTask"))}}
>
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{/if}}
</div>
{{else}}
<a href={{post.url}} class="gh-post-bookmark-wrapper" target="_blank" rel="noopener noreferrer" data-test-complete-bookmark>
<GhPostBookmark @post={{post}} />
</a>
{{#if post.isScheduled}}
<p class="gh-publish-confirmation">
Need to make a change?
<button
type="button"
class="gh-revert-to-draft"
{{on "click" (fn @close (hash afterTask="revertToDraftTask"))}}
data-test-button="revert-to-draft"
>
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{else}}
<p class="gh-publish-confirmation">
<button
type="button"
class="gh-back-to-editor"
{{on "click" @close}}
data-test-button="back-to-editor"
>
<span>Back to editor</span>
</button>
</p>
{{/if}}
{{/if}}
{{/let}}