<%= t('Batch') %>

<% status = CanvasSync::JobBatches::Batch::Status.new(@batch) %>
<%= t('Batch') %> <%= @batch.bid %>
<%= t('Started') %> <%= safe_relative_time(@batch.created_at.to_f) %>
<%= t('Description') %> <%= @batch.description %>
<%= t('Added Context') %>
<%= @batch.context.own.to_json %>
<%= t('Full Context') %>
<%= @batch.context.flatten.to_json %>
Jobs
<%= t('Pending') %> <%= status.pending %>
<%= t('Failed') %> <%= status.failures %>
<%= t('Complete') %> <%= status.completed_count %>
<%= t('Total') %> <%= status.job_count %>
Batches
<%= t('Pending') %> <%= status.child_count - status.successful_children_count %>
<%= t('Failed') %> <%= status.failed_children_count %>
<%= t('Success') %> <%= status.successful_children_count %>
<%= t('Total') %> <%= status.child_count %>

<%= t('Jobs') %>

<% @current_page = @current_jobs_page @total_size = @total_jobs_size %> <% if @jobs.any? && @total_size > @count.to_i %>
<%= erb get_template(:_pagination), locals: { url: "#{root_path}batches/#{@batch.bid}", page_key: :job_page } %>
<% end %>
<% if @jobs.any? %>
<%= erb get_template(:_batches_table), locals: { batches: @jobs } %>
<% end %>

<%= t('Child Batches') %>

<% @current_page = @current_batches_page @total_size = @total_batches_size %> <% if @sub_batches.any? && @total_size > @count.to_i %>
<%= erb get_template(:_pagination), locals: { url: "#{root_path}batches/#{@batch.bid}", page_key: :batch_page } %>
<% end %>
<% if @sub_batches.any? %>
<%= erb get_template(:_batches_table), locals: { batches: @sub_batches } %>
<% end %>
<%= csrf_tag %> <%= t('GoBack') %>