diaspora/app/assets/javascripts/app/views/post_view.js
2013-12-04 20:08:54 -02:00

17 lines
533 B
JavaScript

app.views.Post = app.views.Base.extend({
presenter : function() {
return _.extend(this.defaultPresenter(), {
authorIsCurrentUser : this.authorIsCurrentUser(),
showPost : this.showPost(),
text : app.helpers.textFormatter(this.model.get("text"), this.model)
})
},
authorIsCurrentUser : function() {
return app.currentUser.authenticated() && this.model.get("author").id == app.user().id
},
showPost : function() {
return (app.currentUser.get("showNsfw")) || !this.model.get("nsfw")
}
});