mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-23 02:41:50 +03:00
2f0a0faba4
refs: https://github.com/TryGhost/Team/issues/1531 - css grid was good when the layout was more complex but it's less needed now - tried out some subtle gradients for the resource box - tidied and cleaned up some css that wasn't needed anymore
60 lines
1.4 KiB
JavaScript
60 lines
1.4 KiB
JavaScript
import Component from '@glimmer/component';
|
|
import {action} from '@ember/object';
|
|
import {inject as service} from '@ember/service';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class Recents extends Component {
|
|
@service store;
|
|
@service feature;
|
|
@service session;
|
|
@service settings;
|
|
@service dashboardStats;
|
|
|
|
@tracked selected = 'posts';
|
|
|
|
@tracked posts = [];
|
|
|
|
@action
|
|
async loadPosts() {
|
|
this.posts = await this.store.query('post', {limit: 5, filter: 'status:published', order: 'published_at desc'});
|
|
}
|
|
|
|
@action
|
|
changeTabToPosts() {
|
|
this.selected = 'posts';
|
|
}
|
|
|
|
@action
|
|
changeTabToActivity() {
|
|
this.selected = 'activity';
|
|
}
|
|
|
|
get postsTabSelected() {
|
|
return (this.selected === 'posts');
|
|
}
|
|
|
|
get activityTabSelected() {
|
|
return (this.selected === 'activity');
|
|
}
|
|
|
|
get shouldDisplay() {
|
|
if (this.feature.improvedOnboarding) {
|
|
return true;
|
|
}
|
|
|
|
const isOwner = this.session.user?.isOwnerOnly;
|
|
const hasCompletedLaunchWizard = this.settings.get('editorIsLaunchComplete');
|
|
|
|
if (isOwner && !hasCompletedLaunchWizard) {
|
|
return false;
|
|
}
|
|
|
|
return true;
|
|
}
|
|
|
|
get areMembersEnabled() {
|
|
const enabled = this.dashboardStats.siteStatus?.membersEnabled;
|
|
return enabled;
|
|
}
|
|
}
|