mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
be0a6d58a0
closes https://github.com/TryGhost/Ghost/issues/11965 - fixes scheduled posts always showing "and sent" - updates status text to match that shown in the editor for scheduled posts
31 lines
894 B
JavaScript
31 lines
894 B
JavaScript
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(' ');
|
|
}
|
|
}
|