diff --git a/ghost/admin/app/components/gh-posts-list-item.hbs b/ghost/admin/app/components/gh-posts-list-item.hbs index ed3417c331..3c6224029a 100644 --- a/ghost/admin/app/components/gh-posts-list-item.hbs +++ b/ghost/admin/app/components/gh-posts-list-item.hbs @@ -18,7 +18,7 @@ {{/if}} {{#if @post.isScheduled}} - – Will be published and sent {{gh-format-post-time @post.publishedAtUTC scheduled=true}} + – Will be published {{this.scheduledText}} {{/if}}
@@ -39,7 +39,7 @@ {{/if}} {{#if @post.isPublished}} - + Published {{/if}} @@ -52,11 +52,11 @@ {{else}} {{#if @post.isScheduled}} - + {{svg-jar "send-email" class="stroke-green-d2"}} {{else}} - + {{svg-jar "send-email" class="stroke-midgrey"}} {{/if}} diff --git a/ghost/admin/app/components/gh-posts-list-item.js b/ghost/admin/app/components/gh-posts-list-item.js index d48415db05..7a2b90d0e9 100644 --- a/ghost/admin/app/components/gh-posts-list-item.js +++ b/ghost/admin/app/components/gh-posts-list-item.js @@ -1,10 +1,30 @@ import Component from '@glimmer/component'; +import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time'; import {inject as service} from '@ember/service'; export default class GhPostsListItemComponent extends Component { @service session; + @service settings; get authorNames() { return this.args.post.authors.map(author => author.name || author.email).join(', '); } + + get scheduledText() { + let {post} = this.args; + let text = []; + + if (post.sendEmailWhenPublished) { + let paid = post.visibility === 'paid'; + text.push(`and sent to ${paid ? 'paid' : 'all'} members`); + } + + let formattedTime = formatPostTime( + post.publishedAtUTC, + {timezone: this.settings.get('timezone'), scheduled: true} + ); + text.push(formattedTime); + + return text.join(' '); + } }