include mods+admins in janitor report for comparison

This commit is contained in:
r888888888
2015-06-18 12:29:24 -07:00
parent f29918c097
commit 5923d869aa
3 changed files with 9 additions and 9 deletions

View File

@@ -1,14 +1,14 @@
module Reports module Reports
class JanitorTrials class JanitorTrials
class Janitor class Janitor
attr_reader :trial attr_reader :user
def initialize(trial) def initialize(user)
@trial = trial @user = user
end end
def user def trial
trial.user JanitorTrial.where(user_id: user.id).first
end end
def since def since
@@ -39,7 +39,7 @@ module Reports
end end
def janitors def janitors
JanitorTrial.where(status: "active").to_a.map {|x| Janitor.new(x)} User.where("level >= ?", User::Levels::JANITOR).to_a.map {|x| Janitor.new(x)}
end end
end end
end end

View File

@@ -2,7 +2,7 @@
<div id="a-user-promotions"> <div id="a-user-promotions">
<h1>Janitor Trial Report</h1> <h1>Janitor Trial Report</h1>
<p>All numbers shown are for the past 3 months. Binomial proportion confidence interval for how likely a janitor's approvals will achieve a score of at at least n with 95% confidence.</p> <p>All numbers shown are for the past 3 months. Binomial proportion confidence interval for how likely a janitor's approvals will achieve a score of at at least n with 95% confidence. Most statistics are not significant unless there are at least 300 approvals.</p>
<table width="100%" class="striped" id="sortable"> <table width="100%" class="striped" id="sortable">
<thead> <thead>
@@ -29,7 +29,7 @@
<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>
<td> <td>
<% if CurrentUser.user.is_moderator? %> <% if CurrentUser.user.is_moderator? && janitor.trial %>
<%= link_to "Promote", promote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %> <%= 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 %> | <%= link_to "Demote", demote_janitor_trial_path(janitor.trial), :method => :put, :remote => true %>
<% end %> <% end %>

View File

@@ -2,7 +2,7 @@
<div id="a-user-promotions"> <div id="a-user-promotions">
<h1>User Promotion Confidence Intervals</h1> <h1>User Promotion Confidence Intervals</h1>
<p>Binomial proportion confidence interval for how likely a user's uploads will achieve a score of at at least n with 95% confidence within the past 30 days.</p> <p>Binomial proportion confidence interval for how likely a user's uploads will achieve a score of at at least n with 95% confidence within the past 30 days. Most statistics are not significant unless there are at least 300 uploads.</p>
<table width="100%" class="striped" id="sortable"> <table width="100%" class="striped" id="sortable">
<thead> <thead>