sis_integration_settings.mustache 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <%
  2. # Copyright (C) 2016 - present Instructure, Inc.
  3. #
  4. # This file is part of Canvas.
  5. #
  6. # Canvas is free software: you can redistribute it and/or modify it under
  7. # the terms of the GNU Affero General Public License as published by the Free
  8. # Software Foundation, version 3 of the License.
  9. #
  10. # Canvas is distributed in the hope that it will be useful, but WITHOUT ANY
  11. # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
  12. # A PARTICULAR PURPOSE. See the GNU Affero General Public License for more
  13. # details.
  14. #
  15. # You should have received a copy of the GNU Affero General Public License along
  16. # with this program. If not, see <http://www.gnu.org/licenses/>.
  17. %>
  18. <fieldset id="sis_integration_settings">
  19. <legend>{{#t}}SIS Integration Settings{{/t}}</legend>
  20. <%= f.label :sis_name, t("If you wish, you can rename \"SIS\" to something more familiar to your staff") %>
  21. <div class="sis-name">
  22. <%= f.fields_for :settings do |settings| %>
  23. <%= settings.label :sis_name, t("SIS friendly name") %>
  24. <%= settings.text_field :sis_name, :value => @account.settings[:sis_name], :maxlength => 255, :disabled => !@account.root_account? %>
  25. <% end %>
  26. </div>
  27. <div>
  28. <%= f.check_box :allow_sis_import, :checked => @account.allow_sis_import %>
  29. <%= f.label :allow_sis_import, t("SIS imports") %>
  30. </div>
  31. <% if @account.feature_allowed?(:post_grades)%>
  32. <%= f.fields_for :settings do |settings| %>
  33. <%= settings.fields_for :sis_syncing do |ff_syncing| %>
  34. <%
  35. sis_syncing = @account.sis_syncing
  36. sis_syncing_locked_subs = sis_syncing[:locked] && sis_syncing[:inherited]
  37. %>
  38. <div>
  39. <%= ff_syncing.check_box :value, :checked => sis_syncing[:value],
  40. :disabled => sis_syncing_locked_subs,
  41. "aria-controls" => "account_settings_sis_syncing_value_settings" %>
  42. <%= ff_syncing.label :value, t("SIS syncing") %>
  43. </div>
  44. <fieldset id="account_settings_sis_syncing_value_settings" class="nested" style="display: none;">
  45. <legend class="screenreader-only">{{#t}}Additional settings for SIS syncing{{/t}}</legend>
  46. <div>
  47. <%= ff_syncing.check_box :locked, :checked => sis_syncing[:locked],
  48. :disabled => sis_syncing_locked_subs %>
  49. <%= ff_syncing.label :locked, t("Lock this setting for sub-accounts") %>
  50. </div>
  51. <% if Assignment.sis_grade_export_enabled?(@account) %>
  52. <%= settings.fields_for :sis_default_grade_export do |ff_default| %>
  53. <%
  54. default_export = @account.sis_default_grade_export
  55. default_disabled = sis_syncing_locked_subs ||
  56. (default_export[:locked] && default_export[:inherited])
  57. %>
  58. <div>
  59. <%= ff_default.check_box :value, :checked => default_export[:value],
  60. :disabled => default_disabled,
  61. "aria-controls" => "account_settings_sis_default_grade_export_value_settings" %>
  62. <%= ff_default.label :value, t("Default SIS Sync for assignments, quizzes, grade discussion") %>
  63. </div>
  64. <fieldset id="account_settings_sis_default_grade_export_value_settings" class="nested" style="display: none;">
  65. <legend class="screenreader-only">{{#t}}Additional SIS Sync Assignment, Quiz, and Discussion settings{{/t}}</legend>
  66. <%= settings.fields_for :sis_require_assignment_due_date do |ff_due_date| %>
  67. <%
  68. require_due_date = @account.sis_require_assignment_due_date
  69. require_due_date_disabled = sis_syncing_locked_subs ||
  70. (require_due_date[:locked] && require_due_date[:inherited])
  71. %>
  72. <div class="require_assignment_due_date_nested_cleanup">
  73. <%= ff_due_date.check_box :value, :checked => require_due_date[:value],
  74. :disabled => require_due_date_disabled %>
  75. <%= ff_due_date.label :value, t("Require assignment due date") %>
  76. </div>
  77. <% end %>
  78. </fieldset>
  79. <%= settings.fields_for :sis_assignment_name_length do |ff_name_length| %>
  80. <%
  81. name_length = @account.sis_assignment_name_length
  82. name_length_disabled = sis_syncing_locked_subs ||
  83. (name_length[:locked] && name_length[:inherited])
  84. %>
  85. <div>
  86. <%= ff_name_length.check_box :value, :checked => name_length[:value],
  87. :disabled => name_length_disabled,
  88. "aria-controls" => "account_settings_sis_assignment_name_length_value_settings" %>
  89. <%= ff_name_length.label :value, t("Limit assignment names lengths (max 255)") %>
  90. </div>
  91. <fieldset id="account_settings_sis_assignment_name_length_value_settings" class="nested sis_name_length_nested_cleanup">
  92. <div class="name-length-wrapper">
  93. <%= settings.fields_for :sis_assignment_name_length_input do |ff_name_input|%>
  94. <%= ff_name_input.label :value, :en => "Characters"%>
  95. <%= ff_name_input.text_field :value,
  96. :type => "number",
  97. :value => @account.sis_assignment_name_length_input[:value],
  98. :class => "small-input",
  99. :max => 255,
  100. :min => 0,
  101. :disabled => name_length_disabled,
  102. :placeholder => "255"%>
  103. <% end %>
  104. </div>
  105. </fieldset>
  106. <% end %>
  107. <% end %>
  108. <% end %>
  109. </fieldset>
  110. <% end %>
  111. <% end %>
  112. <% end %>
  113. </fieldset>
  114. <%= render partial: 'sis_agent_token_auth', locals: {f: f} %>