show pending sis batch count on sis imports page

Change-Id: I9a7ac217a00ecf8f445e94438f89f2a0e0a3fa03
Reviewed-on: https://gerrit.instructure.com/5358
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: JT Olds <jt@instructure.com>
This commit is contained in:
Cody Cutrer 2011-08-31 09:37:30 -06:00
parent 563af3816f
commit 1df443cf0e
2 changed files with 11 additions and 4 deletions

View File

@ -96,9 +96,7 @@ class SisBatch < ActiveRecord::Base
end
handle_asynchronously :process, :strand => proc { |sis_batch| "sis_batch:account:#{sis_batch.account_id}" }, :priority => Delayed::LOW_PRIORITY
named_scope :needs_processing, lambda{
{:conditions => ["sis_batches.workflow_state = 'needs_processing'"], :order => :created_at}
}
named_scope :needs_processing, :conditions => { :workflow_state => 'created' }, :order => :created_at
def fast_update_progress(val)
self.progress = val

View File

@ -59,7 +59,16 @@
<h3><%= t(:import_log_title, "Import Progress Log") %></h3>
<div id="import_log"></div>
</div>
<% pending_batch_count = @account.sis_batches.needs_processing.count %>
<% pending_batch_count -= 1 if @current_batch && @current_batch.created? %>
<% if pending_batch_count > 0 %>
<div class="pending_batches" style="margin-top: 20px">
<h3><%= t(:pending_batches_title, "Pending Batches") %></h3>
<p><%= t(:pending_batches_count, { :one => "%{count} batch waiting to be processed.", :other => "%{count} batches waiting to be processed." }, :count => pending_batch_count) %></p>
</div>
<% end %>
<% if show_last_batch %>
<div class="last_batch" style="margin-top: 20px;">
<h3><%= t(:last_batch_title, "Last Batch") %></h3>