2020-07-01 20:39:03 +03:00
|
|
|
import Component from '@glimmer/component';
|
2020-11-26 20:19:05 +03:00
|
|
|
import {action} from '@ember/object';
|
2020-07-01 22:28:47 +03:00
|
|
|
import {formatPostTime} from 'ghost-admin/helpers/gh-format-post-time';
|
2017-10-30 12:38:01 +03:00
|
|
|
import {inject as service} from '@ember/service';
|
2020-11-26 20:19:05 +03:00
|
|
|
import {tracked} from '@glimmer/tracking';
|
2016-06-30 21:14:25 +03:00
|
|
|
|
2022-10-07 15:27:57 +03:00
|
|
|
export default class PostsListItemClicks extends Component {
|
2020-12-02 14:47:34 +03:00
|
|
|
@service feature;
|
2020-07-01 20:39:03 +03:00
|
|
|
@service session;
|
2020-07-01 22:28:47 +03:00
|
|
|
@service settings;
|
2017-07-13 12:55:13 +03:00
|
|
|
|
2020-11-26 20:19:05 +03:00
|
|
|
@tracked isHovered = false;
|
|
|
|
|
2022-10-07 15:27:57 +03:00
|
|
|
get post() {
|
|
|
|
return this.args.post;
|
|
|
|
}
|
|
|
|
|
|
|
|
get errorClass() {
|
|
|
|
if (this.post.didEmailFail) {
|
|
|
|
return 'error';
|
|
|
|
}
|
|
|
|
return '';
|
|
|
|
}
|
|
|
|
|
2020-07-01 22:28:47 +03:00
|
|
|
get scheduledText() {
|
|
|
|
let text = [];
|
|
|
|
|
|
|
|
let formattedTime = formatPostTime(
|
2022-10-07 15:27:57 +03:00
|
|
|
this.post.publishedAtUTC,
|
2022-10-07 16:23:21 +03:00
|
|
|
{timezone: this.settings.timezone, scheduled: true}
|
2020-07-01 22:28:47 +03:00
|
|
|
);
|
|
|
|
text.push(formattedTime);
|
|
|
|
|
|
|
|
return text.join(' ');
|
|
|
|
}
|
2020-11-26 20:19:05 +03:00
|
|
|
|
|
|
|
@action
|
|
|
|
mouseOver() {
|
|
|
|
this.isHovered = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
@action
|
|
|
|
mouseLeave() {
|
|
|
|
this.isHovered = false;
|
|
|
|
}
|
2020-07-01 20:39:03 +03:00
|
|
|
}
|