<% # Copyright (C) 2011 - present Instructure, Inc. # # This file is part of Canvas. # # Canvas is free software: you can redistribute it and/or modify it under # the terms of the GNU Affero General Public License as published by the Free # Software Foundation, version 3 of the License. # # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more # details. # # You should have received a copy of the GNU Affero General Public License along # with this program. If not, see . %> <% add_crumb t(:sis_import_crumb, "SIS Import") %> <% set_active_tab "sis_import" %> <% provide :page_title do %><%= t(:page_title, "SIS Import") %> <% end %>

<%= t(:title, "SIS Import") %>

<% if can_do(@account, @current_user, :import_sis) %>
<%= link_to t(:try_import_again_link, "Try import again"), account_sis_import_path %>
<%= form_tag account_sis_imports_path(@account.id), :multipart => true, :id => "sis_importer" do %>

<%= mt(:select_file_instructions, "Select the zip file that you want imported. \n" + "For a description of how to generate these zip files, [please see this documentation](%{url}).", :url => "/doc/api/file.sis_csv.html") %>


<%= mt(:override_sis_stickiness_instructions, "By default, UI changes have priority over SIS import changes; for a number of fields, the SIS import will not change that field's data if an admin has changed that field through the UI. If you select this option, this SIS import will override UI changes. \nSee the documentation for details.") %>

<%= mt(:add_sis_stickiness_instructions, "With this option selected, changes made through this SIS import will be processed as if they are UI changes, preventing subsequent non-overriding SIS imports from changing the fields changed here.") %>

<%= mt(:clear_sis_stickiness_instructions, "With this option selected, all fields in all records touched by this SIS import will be able to be changed in future non-overriding SIS imports.") %>

<% end %>
<% end %>
<%= t(:import_started_message, "The import process has started! This can take a while if there is a lot to import. You can leave the page and come back.") %>

<%= t(:import_log_title, "Import Progress Log") %>

<% pending_batch_count = @account.sis_batches.needs_processing.count %> <% pending_batch_count -= 1 if @current_batch && @current_batch.created? %> <% if pending_batch_count > 0 %>

<%= t(:pending_batches_title, "Pending Batches") %>

<%= t(:pending_batches_count, {:one => "%{count} batch waiting to be processed.", :other => "%{count} batches waiting to be processed."}, :count => pending_batch_count) %>

<% end %> <% if show_last_batch %>

<%= t(:last_batch_title, "Last Batch") %>

<%= t(:started_at_message, "Started: %{started_at}", :started_at => datetime_string(@last_batch.created_at)) %>
<% if @last_batch.diffing_data_set_identifier %>

<%= t("Data Set Identifier: %{data_set_id}", data_set_id: @last_batch.diffing_data_set_identifier) %>

<% if @last_batch.data[:diffed_against_sis_batch_id] %>

<%= t("Incremental update successfully generated against a previous SIS Import.") %>

<% end %> <% end %> <% if @last_batch.workflow_state == 'imported' %> <%= t(:imported_message, "All SIS data was successfully imported.") %> <%= print_counts @last_batch %> <% elsif @last_batch.workflow_state == 'imported_with_messages' %> <%= t(:imported_with_messages_message, "The SIS data was imported but with these messages:") %> <% if @last_batch.errors_attachment_id %>

<%= t('Download the complete list of errors and warnings here.') %> <%= link_to "".html_safe, file_download_url(@last_batch.errors_attachment, verifier: sis_import_error_attachment_token(@last_batch), download: '1', download_frd: '1'), 'aria-label' => t('Download errors_attchment'), 'title' => t('Download errors_attchment') %>

<% end %> <%= print_messages(@last_batch) %> <%= print_counts @last_batch %> <% elsif @last_batch.workflow_state == 'failed' %> <%= t(:import_failed_message, "There was an error importing your SIS data.") %> <% elsif @last_batch.workflow_state == 'failed_with_messages' %> <%= t(:import_failed_with_messages_message, "The import failed with these messages:") %> <% if @last_batch.errors_attachment_id %>

<%= t('Download the complete list of errors and warnings here.') %> <%= link_to "".html_safe, file_download_url(@last_batch.errors_attachment, verifier: sis_import_error_attachment_token(@last_batch), download: '1', download_frd: '1'), 'aria-label' => t('Download errors_attchment'), 'title' => t('Download errors_attchment') %>

<% end %> <%= print_messages(@last_batch) %> <% elsif @last_batch.workflow_state == 'aborted' %> <%= t('The previous SIS batch was aborted') %> <%= print_messages(@last_batch) %> <% end %>

<% end %>
<% js_bundle :sis_import %>