21 lines
603 B
JavaScript
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")
|
|
}
|
|
});
|