bug fixes

This commit is contained in:
Sam 2013-06-26 16:00:17 +10:00
parent 65dc04c00e
commit 148d2f2cd4
2 changed files with 4 additions and 5 deletions

View File

@ -10,7 +10,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
summary: function(){ summary: function(){
return _(this.post_actions) return _(this.post_actions)
.groupBy(function(a){ return a.post_action_type_id }) .groupBy(function(a){ return a.post_action_type_id; })
.map(function(v,k){ .map(function(v,k){
return Em.String.i18n("admin.flags.summary.action_type_" + k, {count: v.length}); return Em.String.i18n("admin.flags.summary.action_type_" + k, {count: v.length});
}) })
@ -52,7 +52,7 @@ Discourse.FlaggedPost = Discourse.Post.extend({
}.property(), }.property(),
topicHidden: function() { topicHidden: function() {
return this.get('topic_visible') === 'f'; return !this.get('topic_visible');
}.property('topic_hidden'), }.property('topic_hidden'),
deletePost: function() { deletePost: function() {
@ -76,11 +76,11 @@ Discourse.FlaggedPost = Discourse.Post.extend({
}, },
postHidden: function() { postHidden: function() {
return (this.get('hidden') === "t"); return (this.get('hidden'));
}.property(), }.property(),
hiddenClass: function() { hiddenClass: function() {
if (this.get('hidden') === "t") return "hidden-post"; if (this.get('hidden')) return "hidden-post";
}.property() }.property()
}); });

View File

@ -16,7 +16,6 @@ describe PostAction do
it "operates correctly" do it "operates correctly" do
PostAction.act(codinghorror, post, PostActionType.types[:spam]) PostAction.act(codinghorror, post, PostActionType.types[:spam])
posts, users = PostAction.flagged_posts_report("") posts, users = PostAction.flagged_posts_report("")
p posts
posts.count.should == 1 posts.count.should == 1
users.count.should == 2 users.count.should == 2
end end