add additional search links in reports, fix order:random for post count=0

This commit is contained in:
r888888888
2015-06-18 17:16:40 -07:00
parent 0239b0077f
commit 29a7b51fcb
3 changed files with 31 additions and 33 deletions

View File

@@ -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

View File

@@ -18,24 +18,22 @@
</tr>
</thead>
<tbody>
<% cache("janitor-trials-report/#{Date.today}") do %>
<% @report.janitors.each do |janitor| %>
<tr>
<td><%= link_to_user janitor.user %></td>
<td data-sort-value="<%= janitor.user.level %>"><%= janitor.user.level_string %></td>
<td><%= link_to janitor.approval_count, posts_path(:tags => "approver:#{janitor.user.name}") %></td>
<td><%= link_to janitor.deleted_count, posts_path(:tags => "approver:#{janitor.user.name} status:deleted") %></td>
<td><%= janitor.percentile_25_score %></td>
<td><%= janitor.percentile_50_score %></td>
<td><%= number_to_percentage janitor.confidence_interval, :precision => 0 %></td>
<td>
<% 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 %>
</td>
</tr>
<% end %>
<% @report.janitors.each do |janitor| %>
<tr>
<td><%= link_to_user janitor.user %></td>
<td data-sort-value="<%= janitor.user.level %>"><%= janitor.user.level_string %></td>
<td><%= link_to janitor.approval_count, posts_path(:tags => "approver:#{janitor.user.name} order:random", :limit => 300) %></td>
<td><%= link_to janitor.deleted_count, posts_path(:tags => "approver:#{janitor.user.name} status:deleted", :limit => 300) %></td>
<td><%= janitor.percentile_25_score %></td>
<td><%= janitor.percentile_50_score %></td>
<td><%= number_to_percentage janitor.confidence_interval, :precision => 0 %></td>
<td>
<% 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 %>
</td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -19,21 +19,19 @@
</tr>
</thead>
<tbody>
<% cache("user-promotions-report/#{Date.today}") do %>
<% @report.users.each do |user| %>
<% if user.confidence_interval_for(5) > 0 %>
<tr>
<td><%= link_to_user user.user %></td>
<td data-sort-value="<%= user.level %>"><%= user.level_string %></td>
<td><%= user.post_upload_count %></td>
<td data-sort-value="<%= user.created_at.to_formatted_s(:db) %>"><%= time_ago_in_words user.created_at %></td>
<td><%= number_to_percentage user.confidence_interval_for(3), :precision => 0 %></td>
<td><%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %></td>
<td><%= user.quartile_score %></td>
<td><%= user.median_score %></td>
<td><%= number_to_percentage user.deletion_confidence_interval, :precision => 0 %></td>
</tr>
<% end %>
<% @report.users.each do |user| %>
<% if user.confidence_interval_for(5) > 0 %>
<tr>
<td><%= link_to_user user.user %></td>
<td data-sort-value="<%= user.level %>"><%= user.level_string %></td>
<td><%= link_to user.post_upload_count, posts_path(:tags => "uploader:#{user.name} order:random", :limit => 300) %></td>
<td data-sort-value="<%= user.created_at.to_formatted_s(:db) %>"><%= time_ago_in_words user.created_at %></td>
<td><%= number_to_percentage user.confidence_interval_for(3), :precision => 0 %></td>
<td><%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %></td>
<td><%= user.quartile_score %></td>
<td><%= user.median_score %></td>
<td><%= link_to number_to_percentage(user.deletion_confidence_interval, :precision => 0), posts_path(:tags => "uploader:#{user.name} status:deleted", :limit => 300) %></td>
</tr>
<% end %>
<% end %>
</tbody>