Added confirmation message to email-only post being sent

No ref
This commit is contained in:
Sanne de Vries 2022-05-19 10:54:44 +02:00
parent 635dc3ce56
commit df15dcb8d5
3 changed files with 59 additions and 17 deletions

View File

@ -34,23 +34,65 @@
{{/if}}
</div>
{{#unless post.emailOnly}}
{{#if post.emailOnly}}
<div class="gh-publish-confirmation">
<p>
Your post
{{if post.isScheduled "will be" "was"}}
sent to
{{#if post.isScheduled}}
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
{{#if @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize post.email.emailCount "subscribers"}}</strong>
{{else}}
<strong>{{gh-pluralize post.email.emailCount "subscriber"}}</strong> of <strong>{{@publishOptions.post.newsletter.name}}</strong>
{{/if}}
{{/let}}
{{else}}
{{#if @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize post.email.emailCount "subscribers"}}</strong>
{{else}}
<strong>{{gh-pluralize post.email.emailCount "subscriber"}}</strong> of <strong>{{@publishOptions.post.newsletter.name}}</strong>
{{/if}}
{{/if}}
{{#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">
<GhPostBookmark @post={{post}} />
</a>
{{/unless}}
{{#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"))}}
>
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{/if}}
{{#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"))}}
>
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{/if}}
{{/if}}
{{/let}}

View File

@ -39,7 +39,7 @@
</strong>
{{#if @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize countFetcher.count "member" without-count=true}}</strong>{{#if this.willPublish}}.{{else}},{{/if}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>{{#if this.willPublish}}.{{else}},{{/if}}
{{else}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
of <strong>{{@publishOptions.newsletter.name}}</strong>{{#if this.willPublish}}.{{else}},{{/if}}

View File

@ -47,14 +47,14 @@
{{#if this.showNewsletterName}}
<strong>{{gh-pluralize countFetcher.count "subscriber"}}</strong> of <strong>{{post.newsletter.name}}</strong>
{{else}}
<strong>{{gh-pluralize countFetcher.count "member"}}</strong>
<strong>{{gh-pluralize countFetcher.count "subscribers"}}</strong>
{{/if}}
{{/let}}
{{else}}
{{#if this.showNewsletterName}}
<strong>{{gh-pluralize post.email.emailCount "subscriber"}}</strong> of <strong>{{post.newsletter.name}}</strong>
{{else}}
<strong>{{gh-pluralize post.email.emailCount "member"}}</strong>
<strong>{{gh-pluralize post.email.emailCount "subscribers"}}</strong>
{{/if}}
{{/if}}
{{else}}