a little less broken. formatting is broken on reshares, but the cukes should now pass.
This commit is contained in:
parent
bb95bf55f6
commit
b2be1b2c53
2 changed files with 8 additions and 7 deletions
|
|
@ -1,14 +1,12 @@
|
||||||
app.views.Content = app.views.StreamObject.extend({
|
app.views.Content = app.views.StreamObject.extend({
|
||||||
presenter : function(model){
|
presenter : function(model){
|
||||||
var model = model || this.model
|
var model = model || this.model
|
||||||
console.log(model.get("author"))
|
|
||||||
|
|
||||||
return _.extend(this.defaultPresenter(), {
|
return _.extend(this.defaultPresenter(), {
|
||||||
text : app.helpers.textFormatter(model),
|
text : app.helpers.textFormatter(model),
|
||||||
o_embed_html : embedHTML(model),
|
o_embed_html : embedHTML(model),
|
||||||
largePhoto : this.largePhoto(model),
|
largePhoto : this.largePhoto(model),
|
||||||
smallPhotos : this.smallPhotos(model),
|
smallPhotos : this.smallPhotos(model)
|
||||||
root : this.rootPresenter(model)
|
|
||||||
})
|
})
|
||||||
|
|
||||||
function embedHTML(model){
|
function embedHTML(model){
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,13 @@ app.views.Feedback = app.views.StreamObject.extend({
|
||||||
},
|
},
|
||||||
|
|
||||||
userCanReshare : function() {
|
userCanReshare : function() {
|
||||||
var publicPost = this.model.get("public");
|
var isReshare = this.model.get("post_type") == "Reshare"
|
||||||
var userIsNotAuthor = this.model.get("author").id != app.user().id;
|
var rootExists = (isReshare ? this.model.get("root") : true)
|
||||||
var rootExists = (this.model.get("post_type") == "Reshare" ? 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;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue