0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-17 23:44:39 -05:00

Standardized on "subscriber" for default & multiple newsletters in publish flow

no issue

- "subscriber" makes more sense than "member" in the default-only newsletter state because members still need to be subscribed to the default newsletter
- removed all subscriber/member conditionals and cleaned up template logic where possible
This commit is contained in:
Kevin Ansfield 2022-05-19 11:37:01 +01:00
parent 2fb62708a8
commit dce531cf1c
3 changed files with 28 additions and 36 deletions

View file

@ -40,24 +40,22 @@
Your post
{{if post.isScheduled "will be" "was"}}
sent to
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
<strong>
{{if (eq @recipientType "all") "all"}}
{{countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{!-- @recipientType = free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
</strong>
{{#if @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
{{else}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
of <strong>{{@publishOptions.newsletter.name}}</strong>,
{{/if}}
{{#unless @publishOptions.onlyDefaultNewsletter}}
of <strong>{{@publishOptions.newsletter.name}}</strong>{{if post.isScheduled "," "."}}
{{/unless}}
{{/let}}
{{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}}
@ -78,7 +76,7 @@
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{/if}}
{{/if}}
</div>
{{else}}
<a href={{post.url}} class="gh-post-bookmark-wrapper" target="_blank" rel="noopener noreferrer">
@ -96,7 +94,7 @@
<span>Unschedule and revert to draft &rarr;</span>
</button>
</p>
{{/if}}
{{/if}}
{{/if}}
{{/let}}

View file

@ -41,23 +41,22 @@
<div class="gh-publish-setting-trigger">
{{#if @publishOptions.recipientFilter}}
{{#let (members-count-fetcher query=(hash filter=@publishOptions.fullRecipientFilter)) as |countFetcher|}}
{{#if (gt countFetcher.count 1)}}
{{#if (or (gt countFetcher.count 1) (is-empty countFetcher.count))}}
{{if (eq @recipientType "all") "All"}}
{{/if}}
{{format-number countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}}
{{#let (if (not-eq @recipientType "all") @recipientType) as |recipientType|}}
{{if (is-empty countFetcher.count) (capitalize recipientType) recipientType}}
{{!-- @recipientType = all/free/paid/all/specific --}}
{{#if (not-eq @recipientType "all")}}
{{if (is-empty countFetcher.count) (capitalize @recipientType) @recipientType}}
{{/if}}
{{#if @publishOptions.onlyDefaultNewsletter}}
{{gh-pluralize countFetcher.count (if (and (is-empty countFetcher.count) (not recipientType)) "Subscriber" "subscriber") without-count=true}}
{{else}}
{{gh-pluralize countFetcher.count (if (and (is-empty countFetcher.count) (not recipientType)) "Subscriber" "subscriber") without-count=true}}
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/if}}
{{/let}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
{{#unless @publishOptions.onlyDefaultNewsletter}}
of <span class="gh-selected-newsletter">{{@publishOptions.newsletter.name}}</span>
{{/unless}}
{{/let}}
{{else}}
Not sent as newsletter
@ -99,7 +98,7 @@
Already sent to
{{@publishOptions.post.email.emailCount}}
{{if (not-eq @recipientType "all") @recipientType}} {{!-- free/paid/specific --}}
{{gh-pluralize @publishOptions.post.email.emailCount (if @publishOptions.onlyDefaultNewsletter "member" "subscriber") without-count=true}}
{{gh-pluralize @publishOptions.post.email.emailCount "subscriber" without-count=true}}
{{#unless @publishOptions.onlyDefaultNewsletter}}
of {{@publishOptions.post.newsletter.name}}
{{/unless}}

View file

@ -44,18 +44,12 @@
{{#if post.isScheduled}}
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
{{#if this.showNewsletterName}}
<strong>{{gh-pluralize countFetcher.count "subscriber"}}</strong> of <strong>{{post.newsletter.name}}</strong>
{{else}}
<strong>{{gh-pluralize countFetcher.count "subscribers"}}</strong>
{{/if}}
<strong>{{gh-pluralize countFetcher.count "subscriber"}}</strong>
{{#if this.showNewsletterName}}of <strong>{{post.newsletter.name}}</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 "subscribers"}}</strong>
{{/if}}
<strong>{{gh-pluralize post.email.emailCount "subscriber"}}</strong>
{{#if this.showNewsletterName}}of <strong>{{post.newsletter.name}}</strong>{{/if}}
{{/if}}
{{else}}
published on your site
@ -72,13 +66,14 @@
{{#if (and post.isScheduled post.email)}}
This post was previously emailed to
<strong>{{pluralize post.email.emailCount "subscriber"}}</strong>
{{#if this.showNewsletterName}}
<strong>{{pluralize post.email.emailCount "subscriber"}}</strong> of <strong>{{post.newsletter.name}}</strong> on
{{else}}
<strong>{{pluralize post.email.emailCount "member"}}</strong> on
of <strong>{{post.newsletter.name}}</strong>
{{/if}}
{{#let (moment-site-tz post.email.createdAtUTC) as |sentAt|}}
on
{{moment-format sentAt "D MMM YYYY"}}
at
{{moment-format sentAt "HH:mm"}}.