2014-03-03 21:18:10 +01:00
|
|
|
var PostController = Ember.ObjectController.extend({
|
2014-05-31 19:32:22 +01:00
|
|
|
isPublished: Ember.computed.equal('status', 'published'),
|
2014-06-16 05:44:07 +00:00
|
|
|
classNameBindings: ['featured'],
|
2014-05-21 07:53:00 -06:00
|
|
|
|
2014-04-20 08:48:34 -06:00
|
|
|
actions: {
|
2014-05-09 00:00:10 -05:00
|
|
|
toggleFeatured: function () {
|
2014-07-14 22:02:34 -06:00
|
|
|
var options = {disableNProgress: true},
|
2014-06-16 05:44:07 +00:00
|
|
|
self = this;
|
2014-05-09 00:00:10 -05:00
|
|
|
|
2014-07-14 22:02:34 -06:00
|
|
|
this.toggleProperty('featured');
|
|
|
|
this.get('model').save(options).catch(function (errors) {
|
2014-06-20 17:36:44 -04:00
|
|
|
self.notifications.showErrors(errors);
|
2014-06-16 05:44:07 +00:00
|
|
|
});
|
2014-04-20 08:48:34 -06:00
|
|
|
}
|
|
|
|
}
|
2014-03-03 21:18:10 +01:00
|
|
|
});
|
|
|
|
|
2014-06-29 23:45:03 +02:00
|
|
|
export default PostController;
|