Ghost/ghost/admin/app/components/gh-posts-list-item.js
Kevin Ansfield ca97f84cad Added emailAnalytics feature flag
no issue

- email analytics feature has a potential to be resource-intensive so it may be switched off via config, when this is the case we don't want to show stats in the admin that are out of date or won't be added/updated
- fixed page link titles saying "Edit this post" instead of "Edit this page"
2020-12-02 11:47:34 +00:00

46 lines
1.1 KiB
JavaScript

import Component from '@glimmer/component';
import {action} from '@ember/object';
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
import {inject as service} from '@ember/service';
import {tracked} from '@glimmer/tracking';
export default class GhPostsListItemComponent extends Component {
@service feature;
@service session;
@service settings;
@tracked isHovered = false;
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 = [];
let formattedTime = formatPostTime(
post.publishedAtUTC,
{timezone: this.settings.get('timezone'), scheduled: true}
);
text.push(formattedTime);
return text.join(' ');
}
@action
mouseOver() {
this.isHovered = true;
}
@action
mouseLeave() {
this.isHovered = false;
}
}