a little less broken. formatting is broken on reshares, but the cukes should now pass.

This commit is contained in:
danielgrippi 2012-02-05 22:58:08 -08:00
parent bb95bf55f6
commit b2be1b2c53
2 changed files with 8 additions and 7 deletions

View file

@ -1,14 +1,12 @@
app.views.Content = app.views.StreamObject.extend({
presenter : function(model){
var model = model || this.model
console.log(model.get("author"))
return _.extend(this.defaultPresenter(), {
text : app.helpers.textFormatter(model),
o_embed_html : embedHTML(model),
largePhoto : this.largePhoto(model),
smallPhotos : this.smallPhotos(model),
root : this.rootPresenter(model)
smallPhotos : this.smallPhotos(model)
})
function embedHTML(model){

View file

@ -33,10 +33,13 @@ app.views.Feedback = app.views.StreamObject.extend({
},
userCanReshare : function() {
var publicPost = this.model.get("public");
var userIsNotAuthor = this.model.get("author").id != app.user().id;
var rootExists = (this.model.get("post_type") == "Reshare" ? this.model.get("root") : true);
var isReshare = this.model.get("post_type") == "Reshare"
var rootExists = (isReshare ? this.model.get("root") : true)
return publicPost && userIsNotAuthor && rootExists;
var publicPost = this.model.get("public");
var userIsNotAuthor = this.model.get("author").diaspora_id != app.user().diaspora_id;
var userIsNotRootAuthor = rootExists && (isReshare ? this.model.get("root").author.diaspora_id != app.user().diaspora_id : true)
return publicPost && userIsNotAuthor && userIsNotRootAuthor;
}
})