diff --git a/app/logical/post_sets/post.rb b/app/logical/post_sets/post.rb index 0d9d349a2..40a8fbe9b 100644 --- a/app/logical/post_sets/post.rb +++ b/app/logical/post_sets/post.rb @@ -73,6 +73,8 @@ module PostSets count = ::Post.fast_count(tag_string, :statement_timeout => CurrentUser.user.statement_timeout) if count == 1_000_000 # count timed out chance = 0.01 + elsif count == 0 + chance = 1 else chance = per_page / count.to_f end diff --git a/app/views/reports/janitor_trials.html.erb b/app/views/reports/janitor_trials.html.erb index 0077ce2fa..a0fb193b7 100644 --- a/app/views/reports/janitor_trials.html.erb +++ b/app/views/reports/janitor_trials.html.erb @@ -18,24 +18,22 @@ - <% cache("janitor-trials-report/#{Date.today}") do %> - <% @report.janitors.each do |janitor| %> - - <%= link_to_user janitor.user %> - <%= janitor.user.level_string %> - <%= link_to janitor.approval_count, posts_path(:tags => "approver:#{janitor.user.name}") %> - <%= link_to janitor.deleted_count, posts_path(:tags => "approver:#{janitor.user.name} status:deleted") %> - <%= janitor.percentile_25_score %> - <%= janitor.percentile_50_score %> - <%= number_to_percentage janitor.confidence_interval, :precision => 0 %> - - <% if CurrentUser.user.is_moderator? && janitor.trial %> - <%= link_to "Promote", promote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %> - | <%= link_to "Demote", demote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %> - <% end %> - - - <% end %> + <% @report.janitors.each do |janitor| %> + + <%= link_to_user janitor.user %> + <%= janitor.user.level_string %> + <%= link_to janitor.approval_count, posts_path(:tags => "approver:#{janitor.user.name} order:random", :limit => 300) %> + <%= link_to janitor.deleted_count, posts_path(:tags => "approver:#{janitor.user.name} status:deleted", :limit => 300) %> + <%= janitor.percentile_25_score %> + <%= janitor.percentile_50_score %> + <%= number_to_percentage janitor.confidence_interval, :precision => 0 %> + + <% if CurrentUser.user.is_moderator? && janitor.trial %> + <%= link_to "Promote", promote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %> + | <%= link_to "Demote", demote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %> + <% end %> + + <% end %> diff --git a/app/views/reports/user_promotions.html.erb b/app/views/reports/user_promotions.html.erb index 3e8c7be2f..fe1774b33 100644 --- a/app/views/reports/user_promotions.html.erb +++ b/app/views/reports/user_promotions.html.erb @@ -19,21 +19,19 @@ - <% cache("user-promotions-report/#{Date.today}") do %> - <% @report.users.each do |user| %> - <% if user.confidence_interval_for(5) > 0 %> - - <%= link_to_user user.user %> - <%= user.level_string %> - <%= user.post_upload_count %> - <%= time_ago_in_words user.created_at %> - <%= number_to_percentage user.confidence_interval_for(3), :precision => 0 %> - <%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %> - <%= user.quartile_score %> - <%= user.median_score %> - <%= number_to_percentage user.deletion_confidence_interval, :precision => 0 %> - - <% end %> + <% @report.users.each do |user| %> + <% if user.confidence_interval_for(5) > 0 %> + + <%= link_to_user user.user %> + <%= user.level_string %> + <%= link_to user.post_upload_count, posts_path(:tags => "uploader:#{user.name} order:random", :limit => 300) %> + <%= time_ago_in_words user.created_at %> + <%= number_to_percentage user.confidence_interval_for(3), :precision => 0 %> + <%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %> + <%= user.quartile_score %> + <%= user.median_score %> + <%= link_to number_to_percentage(user.deletion_confidence_interval, :precision => 0), posts_path(:tags => "uploader:#{user.name} status:deleted", :limit => 300) %> + <% end %> <% end %>