diaspora/public/javascripts/app/views/post_view.js
2012-03-27 14:54:27 -07:00

21 lines
603 B
JavaScript

app.views.Post = app.views.StreamObject.extend({
initialize : function(options) {
this.templateName = options.templateName
},
presenter : function() {
return _.extend(this.defaultPresenter(), {
authorIsCurrentUser : this.authorIsCurrentUser(),
showPost : this.showPost(),
text : app.helpers.textFormatter(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")
}
});