mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-20 09:22:49 +03:00
59e7b720a2
refs https://github.com/TryGhost/Team/issues/1598 - added `<GhPostBookmark>` card for displaying a bookmark card style representation of a post - updated designsandbox route to include it for easier styling without needing to constantly go through the publish flow to see changes whilst styling - updated publish flow complete step to render a bookmark card if a post/page was published - added `{{post-author-names}}` helper so the author name concatenation logic can be re-used across the posts list and bookmark component
42 lines
1.0 KiB
JavaScript
42 lines
1.0 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 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;
|
|
}
|
|
}
|