mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-02 08:13:34 +03:00
f4d75388fd
fixes https://github.com/TryGhost/Team/issues/2919 This pull request implements a new feature that allows bulk editing of posts by a filter. It adds a new `bulkEdit` endpoint to the posts API and new `PostsService` methods to handle the bulk actions. The posts list component is duplicated, so we can keep working in a copied version without affecting the old version without a flag. It temporarily adds a star icon to indicate featured posts in the posts list.
47 lines
1009 B
JavaScript
47 lines
1009 B
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 PostsListItemClicks extends Component {
|
|
@service feature;
|
|
@service session;
|
|
@service settings;
|
|
|
|
@tracked isHovered = false;
|
|
|
|
get post() {
|
|
return this.args.post;
|
|
}
|
|
|
|
get errorClass() {
|
|
if (this.post.didEmailFail) {
|
|
return 'error';
|
|
}
|
|
return '';
|
|
}
|
|
|
|
get scheduledText() {
|
|
let text = [];
|
|
|
|
let formattedTime = formatPostTime(
|
|
this.post.publishedAtUTC,
|
|
{timezone: this.settings.timezone, scheduled: true}
|
|
);
|
|
text.push(formattedTime);
|
|
|
|
return text.join(' ');
|
|
}
|
|
|
|
@action
|
|
mouseOver() {
|
|
this.isHovered = true;
|
|
}
|
|
|
|
@action
|
|
mouseLeave() {
|
|
this.isHovered = false;
|
|
}
|
|
}
|