%
# Copyright (C) 2016 - 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 .
%>
<%= t("SIS Integration Settings") %>
<%= f.label :sis_name, t("If you wish, you can rename \"SIS\" to something more familiar to your staff") %>
<%= f.fields_for :settings do |settings| %>
<%= settings.label :sis_name, t("SIS friendly name") %>
<%= settings.text_field :sis_name, :value => @account.settings[:sis_name], :maxlength => 255, :disabled => !@account.root_account? %>
<% end %>
<%= f.check_box :allow_sis_import, :checked => @account.allow_sis_import %>
<%= f.label :allow_sis_import, t("SIS imports") %>
<%= f.fields_for :settings do |settings| %>
<%= settings.check_box :include_integration_ids_in_gradebook_exports, :checked => @account.settings[:include_integration_ids_in_gradebook_exports] == true %>
<%= settings.label :include_integration_ids_in_gradebook_exports, t("Include Integration IDs in the gradebook exports.") %>
<% end %>
<% if @account.feature_allowed?(:post_grades)%>
<%= f.fields_for :settings do |settings| %>
<%= settings.fields_for :sis_syncing do |ff_syncing| %>
<%
sis_syncing = @account.sis_syncing
sis_syncing_locked_subs = sis_syncing[:locked] && sis_syncing[:inherited]
%>
<%= ff_syncing.check_box :value, :checked => sis_syncing[:value],
:disabled => sis_syncing_locked_subs,
"aria-controls" => "account_settings_sis_syncing_value_settings" %>
<%= ff_syncing.label :value, t("SIS syncing") %>
<%= t("Additional settings for SIS syncing") %>
<%= ff_syncing.check_box :locked, :checked => sis_syncing[:locked],
:disabled => sis_syncing_locked_subs %>
<%= ff_syncing.label :locked, t("Lock this setting for sub-accounts") %>
<% if Assignment.sis_grade_export_enabled?(@account) %>
<%= settings.fields_for :sis_default_grade_export do |ff_default| %>
<%
default_export = @account.sis_default_grade_export
default_disabled = sis_syncing_locked_subs ||
(default_export[:locked] && default_export[:inherited])
%>
<%= ff_default.check_box :value, :checked => default_export[:value],
:disabled => default_disabled,
"aria-controls" => "account_settings_sis_default_grade_export_value_settings" %>
<%= ff_default.label :value, t("Default SIS Sync for assignments, quizzes, grade discussion") %>
<%= t("Additional SIS Sync Assignment, Quiz, and Discussion settings") %>
<%= settings.fields_for :sis_require_assignment_due_date do |ff_due_date| %>
<%
require_due_date = @account.sis_require_assignment_due_date
require_due_date_disabled = sis_syncing_locked_subs ||
(require_due_date[:locked] && require_due_date[:inherited])
%>
<%= ff_due_date.check_box :value, :checked => require_due_date[:value],
:disabled => require_due_date_disabled %>
<%= ff_due_date.label :value, t("Require assignment due date") %>
<% end %>
<%= settings.fields_for :sis_assignment_name_length do |ff_name_length| %>
<%
name_length = @account.sis_assignment_name_length
name_length_disabled = sis_syncing_locked_subs ||
(name_length[:locked] && name_length[:inherited])
%>
<%= ff_name_length.check_box :value, :checked => name_length[:value],
:disabled => name_length_disabled,
"aria-controls" => "account_settings_sis_assignment_name_length_value_settings" %>
<%= ff_name_length.label :value, t("Limit assignment names lengths (max 255)") %>
<%= settings.fields_for :sis_assignment_name_length_input do |ff_name_input|%>
<%= ff_name_input.label :value, :en => "Characters"%>
<%= ff_name_input.text_field :value,
:type => "number",
:value => @account.sis_assignment_name_length_input[:value],
:class => "small-input",
:max => 255,
:min => 0,
:disabled => name_length_disabled,
:placeholder => "255"%>
<% end %>
<% end %>
<% if @account.allow_disable_post_to_sis_when_grading_period_closed? %>
<% disable_post_to_sis = @account.disable_post_to_sis_when_grading_period_closed? %>
<%= settings.check_box :disable_post_to_sis_when_grading_period_closed, checked: disable_post_to_sis %>
<%= settings.label :disable_post_to_sis_when_grading_period_closed,
t('Automatically disable "Post to SIS" on assignments when grading period closes')
%>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<% end %>
<%= render partial: 'sis_agent_token_auth', locals: {f: f} %>