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

@ -42,22 +42,20 @@
sent to 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> <strong>
{{if (eq @recipientType "all") "all"}} {{if (eq @recipientType "all") "all"}}
{{countFetcher.count}} {{countFetcher.count}}
{{!-- @recipientType = none/free/paid/all/specific --}} {{!-- @recipientType = free/paid/all/specific --}}
{{if (not-eq @recipientType "all") @recipientType}} {{if (not-eq @recipientType "all") @recipientType}}
{{gh-pluralize countFetcher.count "subscriber" without-count=true}}
</strong> </strong>
{{#if @publishOptions.onlyDefaultNewsletter}} {{#unless @publishOptions.onlyDefaultNewsletter}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong> of <strong>{{@publishOptions.newsletter.name}}</strong>{{if post.isScheduled "," "."}}
{{else}} {{/unless}}
<strong>{{gh-pluralize countFetcher.count "subscriber" without-count=true}}</strong>
of <strong>{{@publishOptions.newsletter.name}}</strong>,
{{/if}}
{{/let}} {{/let}}
{{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}} {{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}}

View file

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

View file

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