mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-17 23:44:39 -05:00
Added newsletter name to publish update flow copy
no issue - show the newsletter a post was/will be sent to if there's more than just the default newsletter or the newsletter that was emailed is now archived
This commit is contained in:
parent
1349a03164
commit
cc8dd9dedf
2 changed files with 38 additions and 8 deletions
|
@ -24,7 +24,12 @@
|
|||
|
||||
{{if post.isScheduled "will be" "was"}}
|
||||
|
||||
{{#if (or post.isSent (and post.isPublished post.email) (and post.isScheduled post.emailRecipientFilter (not post.email)))}}
|
||||
{{#if
|
||||
(or post.isSent
|
||||
(and post.isPublished post.email)
|
||||
(and post.isScheduled post.emailRecipientFilter (not post.email))
|
||||
)
|
||||
}}
|
||||
{{#if post.emailOnly}}
|
||||
sent to
|
||||
{{else}}
|
||||
|
@ -33,25 +38,39 @@
|
|||
|
||||
{{#if post.isScheduled}}
|
||||
{{#let (members-count-fetcher query=(hash filter=post.fullRecipientFilter)) as |countFetcher|}}
|
||||
<strong>{{gh-pluralize countFetcher.count "member"}}</strong>
|
||||
{{#if this.showNewsletterName}}
|
||||
<strong>{{gh-pluralize countFetcher.count "subscriber"}}</strong> of <strong>{{post.newsletter.name}}</strong>
|
||||
{{else}}
|
||||
<strong>{{gh-pluralize countFetcher.count "member"}}</strong>
|
||||
{{/if}}
|
||||
{{/let}}
|
||||
{{else}}
|
||||
<strong>{{pluralize post.email.emailCount "member"}}</strong>
|
||||
{{#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>
|
||||
{{/if}}
|
||||
{{/if}}
|
||||
{{else}}
|
||||
published on your site
|
||||
{{/if}}
|
||||
|
||||
{{#let (moment-site-tz post.publishedAtUTC) as |publishedAt|}}
|
||||
on
|
||||
{{moment-format publishedAt "D MMM YYYY"}}
|
||||
at
|
||||
{{moment-format publishedAt "HH:mm"}}.
|
||||
{{moment-format publishedAt "D MMM YYYY"}}
|
||||
at
|
||||
{{moment-format publishedAt "HH:mm"}}.
|
||||
{{/let}}
|
||||
|
||||
{{#if post.isScheduled}}
|
||||
{{#if (and post.isScheduled post.email)}}
|
||||
This post was previously emailed to
|
||||
<strong>{{pluralize post.email.emailCount "member"}}</strong> on
|
||||
|
||||
{{#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
|
||||
{{/if}}
|
||||
|
||||
{{#let (moment-site-tz post.email.createdAtUTC) as |sentAt|}}
|
||||
{{moment-format sentAt "D MMM YYYY"}}
|
||||
|
@ -59,6 +78,7 @@
|
|||
{{moment-format sentAt "HH:mm"}}.
|
||||
{{/let}}
|
||||
{{/if}}
|
||||
|
||||
<br><br>
|
||||
Need to make a change?
|
||||
<button
|
||||
|
|
|
@ -8,6 +8,16 @@ export default class UpdateFlowModalComponent extends Component {
|
|||
ignoreBackdropClick: true
|
||||
};
|
||||
|
||||
// We only show the newsletter name in the app if there's more than the single default newsletter.
|
||||
// However, here we can show historic email data so it could have been sent to a now-archived
|
||||
// newsletter in which case we want to force display of the newsletter name to avoid confusion.
|
||||
get showNewsletterName() {
|
||||
const {publishOptions} = this.args.data;
|
||||
|
||||
return !publishOptions.onlyDefaultNewsletter
|
||||
|| publishOptions.post.newsletter?.status === 'archived';
|
||||
}
|
||||
|
||||
@task
|
||||
*saveTask() {
|
||||
yield this.args.data.saveTask.perform();
|
||||
|
|
Loading…
Add table
Reference in a new issue