mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-29 07:09:48 +03:00
ca97f84cad
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"
46 lines
1.1 KiB
JavaScript
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;
|
|
}
|
|
}
|