add additional search links in reports, fix order:random for post count=0
This commit is contained in:
@@ -73,6 +73,8 @@ module PostSets
|
|||||||
count = ::Post.fast_count(tag_string, :statement_timeout => CurrentUser.user.statement_timeout)
|
count = ::Post.fast_count(tag_string, :statement_timeout => CurrentUser.user.statement_timeout)
|
||||||
if count == 1_000_000 # count timed out
|
if count == 1_000_000 # count timed out
|
||||||
chance = 0.01
|
chance = 0.01
|
||||||
|
elsif count == 0
|
||||||
|
chance = 1
|
||||||
else
|
else
|
||||||
chance = per_page / count.to_f
|
chance = per_page / count.to_f
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,13 +18,12 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% cache("janitor-trials-report/#{Date.today}") do %>
|
|
||||||
<% @report.janitors.each do |janitor| %>
|
<% @report.janitors.each do |janitor| %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to_user janitor.user %></td>
|
<td><%= link_to_user janitor.user %></td>
|
||||||
<td data-sort-value="<%= janitor.user.level %>"><%= janitor.user.level_string %></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.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") %></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_25_score %></td>
|
||||||
<td><%= janitor.percentile_50_score %></td>
|
<td><%= janitor.percentile_50_score %></td>
|
||||||
<td><%= number_to_percentage janitor.confidence_interval, :precision => 0 %></td>
|
<td><%= number_to_percentage janitor.confidence_interval, :precision => 0 %></td>
|
||||||
@@ -36,7 +35,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -19,23 +19,21 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<% cache("user-promotions-report/#{Date.today}") do %>
|
|
||||||
<% @report.users.each do |user| %>
|
<% @report.users.each do |user| %>
|
||||||
<% if user.confidence_interval_for(5) > 0 %>
|
<% if user.confidence_interval_for(5) > 0 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= link_to_user user.user %></td>
|
<td><%= link_to_user user.user %></td>
|
||||||
<td data-sort-value="<%= user.level %>"><%= user.level_string %></td>
|
<td data-sort-value="<%= user.level %>"><%= user.level_string %></td>
|
||||||
<td><%= user.post_upload_count %></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 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(3), :precision => 0 %></td>
|
||||||
<td><%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %></td>
|
<td><%= number_to_percentage user.confidence_interval_for(6), :precision => 0 %></td>
|
||||||
<td><%= user.quartile_score %></td>
|
<td><%= user.quartile_score %></td>
|
||||||
<td><%= user.median_score %></td>
|
<td><%= user.median_score %></td>
|
||||||
<td><%= number_to_percentage user.deletion_confidence_interval, :precision => 0 %></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>
|
</tr>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user