mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
49b86b466a
refs 6140a98351
This officially decouples the newsletter recipients from the post visibility allowing us to send emails to free members only.
35 lines
1.0 KiB
JavaScript
35 lines
1.0 KiB
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 sendEmailWhenPublished() {
|
|
let {post} = this.args;
|
|
return post.emailRecipientFilter && post.emailRecipientFilter !== 'none';
|
|
}
|
|
|
|
get scheduledText() {
|
|
let {post} = this.args;
|
|
let text = [];
|
|
|
|
if (post.emailRecipientFilter && post.emailRecipientFilter !== 'none') {
|
|
text.push(`and sent to ${post.emailRecipientFilter} members`);
|
|
}
|
|
|
|
let formattedTime = formatPostTime(
|
|
post.publishedAtUTC,
|
|
{timezone: this.settings.get('timezone'), scheduled: true}
|
|
);
|
|
text.push(formattedTime);
|
|
|
|
return text.join(' ');
|
|
}
|
|
}
|