0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-27 22:49:56 -05:00
ghost/core/client/app/controllers/posts/post.js
cobbspur d249591290 Nuke nprogress
closes #5328

- removes all references to nprogress and loading indicator
2015-05-26 19:24:32 +01:00

33 lines
1.1 KiB
JavaScript

import Ember from 'ember';
var PostController = Ember.Controller.extend({
isPublished: Ember.computed.equal('model.status', 'published'),
classNameBindings: ['model.featured'],
authorName: Ember.computed('model.author.name', 'model.author.email', function () {
return this.get('model.author.name') || this.get('model.author.email');
}),
authorAvatar: Ember.computed('model.author.image', function () {
return this.get('model.author.image') || this.get('ghostPaths.url').asset('/shared/img/user-image.png');
}),
authorAvatarBackground: Ember.computed('authorAvatar', function () {
return `background-image: url(${this.get('authorAvatar')})`.htmlSafe();
}),
actions: {
toggleFeatured: function () {
var self = this;
this.toggleProperty('model.featured');
this.get('model').save().catch(function (errors) {
self.notifications.showErrors(errors);
});
},
showPostContent: function () {
this.transitionToRoute('posts.post', this.get('model'));
}
}
});
export default PostController;