Merge branch '2875-ignore-user-posts' of https://github.com/hpetru/diaspora into hpetru-2875-ignore-user-posts
Conflicts: Changelog.md
This commit is contained in:
commit
163b76ae3d
4 changed files with 30 additions and 13 deletions
|
|
@ -19,6 +19,7 @@
|
||||||
* Set mention notification as read when viewing post [#5006](https://github.com/diaspora/diaspora/pull/5006)
|
* Set mention notification as read when viewing post [#5006](https://github.com/diaspora/diaspora/pull/5006)
|
||||||
* Set sharing notification as read when viewing profile [#5009](https://github.com/diaspora/diaspora/pull/5009)
|
* Set sharing notification as read when viewing profile [#5009](https://github.com/diaspora/diaspora/pull/5009)
|
||||||
* Ensure a consistent border on text input elements [#5069](https://github.com/diaspora/diaspora/pull/5069)
|
* Ensure a consistent border on text input elements [#5069](https://github.com/diaspora/diaspora/pull/5069)
|
||||||
|
* Fix which allow to remove ignored users posts without page refresh [#2875](https://github.com/diaspora/diaspora/issues/2875)
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
* Port admin pages to bootstrap, polish user search results, allow accounts to be closed from the backend [#5046](https://github.com/diaspora/diaspora/pull/5046)
|
* Port admin pages to bootstrap, polish user search results, allow accounts to be closed from the backend [#5046](https://github.com/diaspora/diaspora/pull/5046)
|
||||||
|
|
|
||||||
|
|
@ -19,6 +19,7 @@ var app = {
|
||||||
views: {},
|
views: {},
|
||||||
pages: {},
|
pages: {},
|
||||||
forms: {},
|
forms: {},
|
||||||
|
vent: _.extend({}, Backbone.Events),
|
||||||
|
|
||||||
user: function(userAttrs) {
|
user: function(userAttrs) {
|
||||||
if(userAttrs) { return this._user = new app.models.User(userAttrs) }
|
if(userAttrs) { return this._user = new app.models.User(userAttrs) }
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,9 @@ app.views.StreamPost = app.views.Post.extend({
|
||||||
tooltipSelector : ".timeago, .post_scope, .block_user, .delete",
|
tooltipSelector : ".timeago, .post_scope, .block_user, .delete",
|
||||||
|
|
||||||
initialize : function(){
|
initialize : function(){
|
||||||
|
var personId = this.model.get('author').id;
|
||||||
|
app.vent.on('remove:author:posts:'+personId, this.remove, this);
|
||||||
|
|
||||||
this.model.on('remove', this.remove, this);
|
this.model.on('remove', this.remove, this);
|
||||||
//subviews
|
//subviews
|
||||||
this.commentStreamView = new app.views.CommentStream({model : this.model});
|
this.commentStreamView = new app.views.CommentStream({model : this.model});
|
||||||
|
|
@ -77,13 +80,7 @@ app.views.StreamPost = app.views.Post.extend({
|
||||||
|
|
||||||
block.save({block : {person_id : personId}}, {
|
block.save({block : {person_id : personId}}, {
|
||||||
success : function(){
|
success : function(){
|
||||||
if(!app.stream) { return }
|
app.vent.trigger('remove:author:posts:'+personId);
|
||||||
|
|
||||||
_.each(app.stream.posts.models, function(model){
|
|
||||||
if(model.get("author").id == personId) {
|
|
||||||
app.stream.posts.remove(model);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,32 @@
|
||||||
describe("app.views.StreamPost", function(){
|
describe("app.views.StreamPost", function(){
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
this.PostViewClass = app.views.StreamPost
|
this.PostViewClass = app.views.StreamPost
|
||||||
|
|
||||||
|
var posts = $.parseJSON(spec.readFixture("stream_json"));
|
||||||
|
this.collection = new app.collections.Posts(posts);
|
||||||
|
this.statusMessage = this.collection.models[0];
|
||||||
|
this.reshare = this.collection.models[1];
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe("events", function(){
|
||||||
|
var _PostViewClass = undefined;
|
||||||
|
var author_id = undefined;
|
||||||
|
|
||||||
|
beforeEach(function(){
|
||||||
|
_PostViewClass = this.PostViewClass;
|
||||||
|
authorId = this.statusMessage.get('author').id;
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("remove posts for blocked person", function(){
|
||||||
|
it("setup remove:author:posts:#{id} to #remove", function(){
|
||||||
|
spyOn(_PostViewClass.prototype, 'remove');
|
||||||
|
view = new _PostViewClass({model : this.statusMessage});
|
||||||
|
app.vent.trigger('remove:author:posts:'+authorId);
|
||||||
|
expect(_PostViewClass.prototype.remove).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("#render", function(){
|
describe("#render", function(){
|
||||||
var o_embed_cache = {
|
var o_embed_cache = {
|
||||||
"data" : {
|
"data" : {
|
||||||
|
|
@ -32,12 +56,6 @@ describe("app.views.StreamPost", function(){
|
||||||
other : "<%= count %> Likes"
|
other : "<%= count %> Likes"
|
||||||
}
|
}
|
||||||
}})
|
}})
|
||||||
|
|
||||||
var posts = $.parseJSON(spec.readFixture("stream_json"));
|
|
||||||
|
|
||||||
this.collection = new app.collections.Posts(posts);
|
|
||||||
this.statusMessage = this.collection.models[0];
|
|
||||||
this.reshare = this.collection.models[1];
|
|
||||||
})
|
})
|
||||||
|
|
||||||
context("reshare", function(){
|
context("reshare", function(){
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue