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:
parent
563af3816f
commit
1df443cf0e
|
@ -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
|
||||
|
|
|
@ -60,6 +60,15 @@
|
|||
<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>
|
||||
|
|
Loading…
Reference in New Issue