From dce531cf1c84fa4ed2d198b6f233af9053879cc9 Mon Sep 17 00:00:00 2001
From: Kevin Ansfield
Date: Thu, 19 May 2022 11:37:01 +0100
Subject: [PATCH] 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
---
.../modals/publish-flow/complete.hbs | 20 ++++++++--------
.../modals/publish-flow/options.hbs | 23 +++++++++----------
.../editor-labs/modals/update-flow.hbs | 21 +++++++----------
3 files changed, 28 insertions(+), 36 deletions(-)
diff --git a/ghost/admin/app/components/editor-labs/modals/publish-flow/complete.hbs b/ghost/admin/app/components/editor-labs/modals/publish-flow/complete.hbs
index 29e6e5494d..17518e3e1b 100644
--- a/ghost/admin/app/components/editor-labs/modals/publish-flow/complete.hbs
+++ b/ghost/admin/app/components/editor-labs/modals/publish-flow/complete.hbs
@@ -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|}}
{{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}}
- {{#if @publishOptions.onlyDefaultNewsletter}}
- {{gh-pluralize countFetcher.count "subscriber" without-count=true}}
- {{else}}
- {{gh-pluralize countFetcher.count "subscriber" without-count=true}}
- of {{@publishOptions.newsletter.name}},
- {{/if}}
+ {{#unless @publishOptions.onlyDefaultNewsletter}}
+ of {{@publishOptions.newsletter.name}}{{if post.isScheduled "," "."}}
+ {{/unless}}
{{/let}}
{{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}}
@@ -78,7 +76,7 @@
Unschedule and revert to draft →
- {{/if}}
+ {{/if}}
{{else}}
@@ -96,7 +94,7 @@
Unschedule and revert to draft →
- {{/if}}
+ {{/if}}
{{/if}}
{{/let}}
\ No newline at end of file
diff --git a/ghost/admin/app/components/editor-labs/modals/publish-flow/options.hbs b/ghost/admin/app/components/editor-labs/modals/publish-flow/options.hbs
index 3ea0eb8d6c..1117b5af33 100644
--- a/ghost/admin/app/components/editor-labs/modals/publish-flow/options.hbs
+++ b/ghost/admin/app/components/editor-labs/modals/publish-flow/options.hbs
@@ -41,23 +41,22 @@
{{#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 {{@publishOptions.newsletter.name}}
- {{/if}}
- {{/let}}
+ {{gh-pluralize countFetcher.count "subscriber" without-count=true}}
+
+ {{#unless @publishOptions.onlyDefaultNewsletter}}
+ of {{@publishOptions.newsletter.name}}
+ {{/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}}
diff --git a/ghost/admin/app/components/editor-labs/modals/update-flow.hbs b/ghost/admin/app/components/editor-labs/modals/update-flow.hbs
index 4b769abacb..df28c42ea1 100644
--- a/ghost/admin/app/components/editor-labs/modals/update-flow.hbs
+++ b/ghost/admin/app/components/editor-labs/modals/update-flow.hbs
@@ -44,18 +44,12 @@
{{#if post.isScheduled}}
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
- {{#if this.showNewsletterName}}
- {{gh-pluralize countFetcher.count "subscriber"}} of {{post.newsletter.name}}
- {{else}}
- {{gh-pluralize countFetcher.count "subscribers"}}
- {{/if}}
+ {{gh-pluralize countFetcher.count "subscriber"}}
+ {{#if this.showNewsletterName}}of {{post.newsletter.name}}{{/if}}
{{/let}}
{{else}}
- {{#if this.showNewsletterName}}
- {{gh-pluralize post.email.emailCount "subscriber"}} of {{post.newsletter.name}}
- {{else}}
- {{gh-pluralize post.email.emailCount "subscribers"}}
- {{/if}}
+ {{gh-pluralize post.email.emailCount "subscriber"}}
+ {{#if this.showNewsletterName}}of {{post.newsletter.name}}{{/if}}
{{/if}}
{{else}}
published on your site
@@ -72,13 +66,14 @@
{{#if (and post.isScheduled post.email)}}
This post was previously emailed to
+ {{pluralize post.email.emailCount "subscriber"}}
+
{{#if this.showNewsletterName}}
- {{pluralize post.email.emailCount "subscriber"}} of {{post.newsletter.name}} on
- {{else}}
- {{pluralize post.email.emailCount "member"}} on
+ of {{post.newsletter.name}}
{{/if}}
{{#let (moment-site-tz post.email.createdAtUTC) as |sentAt|}}
+ on
{{moment-format sentAt "D MMM YYYY"}}
at
{{moment-format sentAt "HH:mm"}}.