FIX: Post count progress was a little off. Minor fix to hidden posts

This commit is contained in:
Robin Ward 2013-12-09 14:28:32 -05:00
parent 5280e279f7
commit 744add9ece
3 changed files with 5 additions and 4 deletions

View File

@ -275,9 +275,9 @@ Discourse.TopicController = Discourse.ObjectController.extend(Discourse.Selected
streamPercentage: function() {
if (!this.get('postStream.loaded')) { return 0; }
if (this.get('postStream.highest_post_number') === 0) { return 0; }
var perc = this.get('progressPosition') / this.get('highest_post_number');
var perc = this.get('progressPosition') / this.get('filteredPostsCount');
return (perc > 1.0) ? 1.0 : perc;
}.property('postStream.loaded', 'progressPosition', 'highest_post_number'),
}.property('postStream.loaded', 'progressPosition', 'filteredPostsCount'),
multiSelectChanged: function() {
// Deselect all posts when multi select is turned off

View File

@ -11,7 +11,7 @@ Discourse.PostView = Discourse.GroupedView.extend(Ember.Evented, {
templateName: 'post',
classNameBindings: ['postTypeClass',
'selected',
'post.hidden:hidden',
'post.hidden:deleted',
'post.deleted'],
postBinding: 'content',

View File

@ -264,7 +264,8 @@ class TopicView
end
def unfiltered_posts
result = @topic.posts.where(hidden: false)
result = @topic.posts
result = result.where(hidden: false) unless @user.try(:staff?)
result = result.with_deleted if @user.try(:staff?)
result
end