17 lines
533 B
JavaScript
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")
|
|
}
|
|
});
|