From b2be1b2c537da7b41fe4942556f60c3347b81488 Mon Sep 17 00:00:00 2001 From: danielgrippi <danielgrippi@gmail.com> Date: Sun, 5 Feb 2012 22:58:08 -0800 Subject: [PATCH] a little less broken. formatting is broken on reshares, but the cukes should now pass. --- public/javascripts/app/views/content_view.js | 4 +--- public/javascripts/app/views/feedback_view.js | 11 +++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/public/javascripts/app/views/content_view.js b/public/javascripts/app/views/content_view.js index abc66b7813..0287b7bf33 100644 --- a/public/javascripts/app/views/content_view.js +++ b/public/javascripts/app/views/content_view.js @@ -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){ diff --git a/public/javascripts/app/views/feedback_view.js b/public/javascripts/app/views/feedback_view.js index 3337906ed4..b63e1781e6 100644 --- a/public/javascripts/app/views/feedback_view.js +++ b/public/javascripts/app/views/feedback_view.js @@ -33,10 +33,13 @@ app.views.Feedback = app.views.StreamObject.extend({ }, userCanReshare : function() { + var isReshare = this.model.get("post_type") == "Reshare" + var rootExists = (isReshare ? this.model.get("root") : true) + 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); - - return publicPost && userIsNotAuthor && rootExists; + 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; } }) -- GitLab