settings.mustache 60 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176
  1. <%
  2. # Copyright (C) 2011 - 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. <%
  19. @active_tab = "settings"
  20. add_crumb t(:settings_crumb, "Settings")
  21. js_bundle :account_settings
  22. css_bundle :account_settings, :reports, :tinymce
  23. content_for :page_title, t(:page_title, "Account Settings")
  24. if can_do(@context, @current_user, :manage_storage_quotas)
  25. js_env :ACCOUNT => {
  26. 'id' => @context.id,
  27. 'default_storage_quota_mb' => @context.default_storage_quota_mb,
  28. 'default_user_storage_quota_mb' => @context.default_user_storage_quota_mb,
  29. 'default_group_storage_quota_mb' => @context.default_group_storage_quota_mb,
  30. 'site_admin' => @account.site_admin?,
  31. 'root_account' => @account.root_account?
  32. }
  33. end
  34. %>
  35. <% content_for :right_side do %>
  36. {{> views/courses_right_side}}
  37. {{> views/additional_settings_right_side}}
  38. <% end %>
  39. <h1 class='screenreader-only'>{{#t}}Account Settings{{/t}}</h1>
  40. <% content_for :stylesheets do %>
  41. <style type="text/css" media="screen">
  42. fieldset {
  43. margin: 2em 0;
  44. }
  45. fieldset.nested {
  46. margin-top: 0;
  47. margin-left: 20px;
  48. }
  49. legend{
  50. font-size: 1.1em;
  51. }
  52. </style>
  53. <% end %>
  54. <div id="account_settings_tabs" style="display:none;" class="ui-tabs-minimal">
  55. <ul>
  56. <% if can_do(@context, @current_user, :manage_account_settings) %>
  57. <li><a href="#tab-settings" id="tab-settings-link">{{#t}}Settings{{/t}}</a></li>
  58. <% end %>
  59. <% if can_do(@context, @current_user, :manage_storage_quotas) %>
  60. <li><a href="#tab-quotas" id="tab-quotas-link">{{#t}}Quotas{{/t}}</a></li>
  61. <% end %>
  62. <% if can_do(@context, @current_user, :manage_account_settings) && @account.root_account? && !@account.site_admin? %>
  63. <li><a href="#tab-notifications" id="tab-notifications-link">{{#t}}Notifications{{/t}}</a></li>
  64. <% end %>
  65. <li><a href="#tab-users" id="tab-users-link">{{#t}}Admins{{/t}}</a></li>
  66. <li><a href="#tab-announcements" id="tab-announcements-link">{{#t}}Announcements{{/t}}</a></li>
  67. <% if !@available_reports.blank? %>
  68. <li><a href="#tab-reports" id="tab-reports-link">{{#t}}Reports{{/t}}</a></li>
  69. <% end %>
  70. <% if can_do(@context, @current_user, :read_as_admin) %>
  71. <li><a href="#tab-tools" id="tab-tools-link">{{#t}}Apps{{/t}}</a></li>
  72. <% end %>
  73. <% if @context.root_account.settings[:enable_alerts] && can_do(@context, @current_user, :manage_interaction_alerts) %>
  74. <li><a href="#tab-alerts" id="tab-alerts-link">{{#t}}Alerts{{/t}}</a></li>
  75. <% end %>
  76. <% if can_do(@context, @current_user, :manage_feature_flags) %>
  77. <li><a href="#tab-features" id="tab-features-link">{{#t}}Feature Options{{/t}}</a></li>
  78. <% end %>
  79. </ul>
  80. <% if can_do(@context, @current_user, :manage_account_settings) %>
  81. <div id="tab-settings">
  82. <h2 class="screenreader-only">{{#t}}Account Settings{{/t}}</h2>
  83. <%= form_for :account, :url => account_url(@account), :html => {:method => :put, :id => "account_settings", :class => 'account_settings'} do |f| %>
  84. <fieldset id="account_settings">
  85. <legend>{{#t}}Account Settings{{/t}}</legend>
  86. <table class="formtable">
  87. <tr>
  88. <td><%= f.blabel :name, :en => "Account Name" %></td>
  89. <td><%= f.text_field :name, :class => 'same-width-as-select' %></td>
  90. </tr>
  91. <% if !@account.root_account? && (@context.sis_source_id && can_do(@context.root_account, @current_user, :read_sis) || can_do(@context.root_account, @current_user, :manage_sis)) %>
  92. <tr>
  93. <td><%= f.blabel :sis_source_id, :en => "SIS ID" %></td>
  94. <td>
  95. <span class="course_form">
  96. <% if can_do(@context.root_account, @current_user, :manage_sis) %>
  97. <%= f.text_field :sis_source_id, :title => "SIS ID", :value => @context.sis_source_id %>
  98. <% else %>
  99. <span class="sis_source_id"><%= @context.sis_source_id %></span>
  100. <% end %>
  101. </span>
  102. </td>
  103. </tr>
  104. <% end %>
  105. <% if available_locales.size > 1 %>
  106. <tr>
  107. <td><%= f.blabel :default_locale, :default_language, :en => "Default Language" %></td>
  108. <td>
  109. <% no_language = t(:no_language_preference, "Not set (defaults to %{language})", :language => available_locales[infer_locale(:context => @context.parent_account)]) %>
  110. <%= f.select :default_locale,
  111. [[no_language, nil]] + available_locales.invert.sort_by { |desc, _| Canvas::ICU.collation_key(desc) },
  112. {:selected => @context.default_locale}, {:class => 'locale'} %>
  113. {{> views/shared/locale_warning}}
  114. <p class="unbreakable"><%= mt :transifex_message, <<-TEXT, :transifex_url => "https://www.transifex.com/instructure/canvas-crowdsource/"
  115. Join the [Canvas Translation Community](%{transifex_url})
  116. TEXT
  117. %>
  118. </p>
  119. <p style="font-size: 0.9em;">{{#t}}This will override any browser/OS language settings. Preferred languages can still be set at the course/user level.{{/t}}</p>
  120. </td>
  121. </tr>
  122. <% end %>
  123. <% if @account.root_account? %>
  124. <tr>
  125. <td><%= f.blabel :default_time_zone, :en => "Default Time Zone" %></td>
  126. <td>
  127. <%= f.time_zone_select :default_time_zone, I18nTimeZone.us_zones, :model => I18nTimeZone %>
  128. </td>
  129. </tr>
  130. <%= f.fields_for :settings do |settings| %>
  131. <% if @account.grants_right?(@current_user, :manage_site_settings) %>
  132. <tr>
  133. <td><%= settings.blabel :mfa_settings, :en => "Multi-Factor Authentication" %></td>
  134. <td><%= settings.select :mfa_settings, [[t('select.mfa.disabled', "Disabled"), :disabled],
  135. [t('select.mfa.optional', "Optional"), :optional],
  136. [t('select.mfa.required_for_admins', "Required for Admins"), :required_for_admins],
  137. [t('select.mfa.required', "Required"), :required]], :selected => @account.mfa_settings %>
  138. </td>
  139. </tr>
  140. <% end %>
  141. <% unless @account.site_admin? %>
  142. <tr>
  143. <td><%= settings.blabel :self_enrollment, :en => "Allow Self-Enrollment" %></td>
  144. <td>
  145. <%= settings.select :self_enrollment, [
  146. [t(:never_allow_self_enrollment_option, 'Never'), ''],
  147. [t(:self_enroll_for_manually_created_courses_option, 'For Manually-Created Courses'), 'manually_created'],
  148. [t(:self_enroll_for_any_courses_option, 'For Any Courses'), 'any']
  149. ], :selected => @account.settings[:self_enrollment] %>
  150. </td>
  151. </tr>
  152. <% unless @account.non_canvas_auth_configured?
  153. # if the account has a account_authorization_config,
  154. # we'll control this setting from that page
  155. %>
  156. <tr>
  157. <td>
  158. <%= settings.blabel :login_handle_name, en: "Login Label" %>
  159. </td>
  160. <td>
  161. <%= settings.text_field :login_handle_name,
  162. value: @account.login_handle_name,
  163. class: 'same-width-as-select',
  164. placeholder: t(:login_handle_name_placeholder, "ex: Login, Username, or Student ID") %>
  165. </td>
  166. </tr>
  167. <% end %>
  168. <tr>
  169. <td><%= settings.blabel :trusted_referers, :en => "Trusted HTTP Referers" %></td>
  170. <td>
  171. <%= settings.text_field :trusted_referers,
  172. :value => @account.settings[:trusted_referers],
  173. :class => 'same-width-as-select',
  174. :placeholder => "https://example.edu" %>
  175. <p style="font-size: 0.9em;">{{#t}}This is a comma separated list of URL's to trust. Trusting any URL's in this list will bypass the CSRF token when logging in to Canvas.{{/t}}</p>
  176. </td>
  177. </tr>
  178. <tr>
  179. <td colspan="2"><%= settings.check_box :prevent_course_renaming_by_teachers, :checked => @account.settings[:prevent_course_renaming_by_teachers] %>
  180. <%= settings.label :prevent_course_renaming_by_teachers, :en => "Don't let teachers rename their courses" %>
  181. </td>
  182. </tr>
  183. <tr>
  184. <td colspan="2"><%= settings.check_box :allow_sending_scores_in_emails, :checked => @account.settings[:allow_sending_scores_in_emails] != false %>
  185. <%= settings.label :allow_sending_scores_in_emails, :en => "Students can opt-in to receiving scores in email notifications" %>
  186. </td>
  187. </tr>
  188. <% if @account.grants_right?(@current_user, :manage_site_settings) %>
  189. <tr>
  190. <td colspan="2"><%= settings.check_box :include_students_in_global_survey, checked: @account.include_students_in_global_survey?%>
  191. <%= settings.label :include_students_in_global_survey, en: "Include students in global surveys" %>
  192. </td>
  193. </tr>
  194. <% end %>
  195. <tr>
  196. <td colspan="2"><%= settings.check_box :restrict_quiz_questions, :checked => @account.settings[:restrict_quiz_questions] %>
  197. <%= settings.label :restrict_quiz_questions, :en => "Restrict students from viewing quiz questions after course end date" %>
  198. </td>
  199. </tr>
  200. <% end %>
  201. <% end %>
  202. <% end %>
  203. <% unless @account.site_admin? %>
  204. <%= f.fields_for :settings do |settings| %>
  205. <%= settings.fields_for :restrict_student_future_view do |r| %>
  206. <% hash = @account.restrict_student_future_view %>
  207. <% disabled = hash[:locked] && hash[:inherited] %>
  208. <tr>
  209. <td colspan="2"><%= r.check_box :value, :checked => hash[:value], :disabled => disabled %>
  210. <%= r.label :value , t("Restrict students from accessing courses before start date") %>
  211. </td>
  212. </tr>
  213. <% unless disabled %>
  214. <tr>
  215. <td colspan="2" class="sub_checkbox">
  216. <%= r.check_box :locked, :checked => hash[:locked] %>
  217. <%= r.label :locked, :en => "Lock this setting for sub-accounts and courses" %>
  218. </td>
  219. </tr>
  220. <% end %>
  221. <% end %>
  222. <%= settings.fields_for :restrict_student_future_listing do |r| %>
  223. <% hash = @account.restrict_student_future_listing %>
  224. <% disabled = hash[:locked] && hash[:inherited] %>
  225. <tr class="future_listing">
  226. <td colspan="2"><%= r.check_box :value, :checked => hash[:value], :disabled => disabled %>
  227. <%= r.label :restrict_student_future_listing, :en => "Restrict students from viewing future courses in enrollments list" %>
  228. </td>
  229. </tr>
  230. <% unless disabled %>
  231. <tr class="future_listing">
  232. <td colspan="2" class="sub_checkbox">
  233. <%= r.check_box :locked, :checked => hash[:locked] %>
  234. <%= r.label :locked, t("Lock this setting for sub-accounts") %>
  235. </td>
  236. </tr>
  237. <% end %>
  238. <% end %>
  239. <%= settings.fields_for :restrict_student_past_view do |r| %>
  240. <% hash = @account.restrict_student_past_view %>
  241. <% disabled = hash[:locked] && hash[:inherited] %>
  242. <tr>
  243. <td colspan="2"><%= r.check_box :value, :checked => hash[:value], :disabled => disabled %>
  244. <%= r.label :value, t("Restrict students from accessing courses after end date") %>
  245. </td>
  246. </tr>
  247. <% unless disabled %>
  248. <tr>
  249. <td colspan="2" class="sub_checkbox">
  250. <%= r.check_box :locked, :checked => hash[:locked] %>
  251. <%= r.label :locked, :en => "Lock this setting for sub-accounts and courses" %>
  252. </td>
  253. </tr>
  254. <% end %>
  255. <% end %>
  256. <%= settings.fields_for :lock_all_announcements do |r| %>
  257. <% hash = @account.lock_all_announcements %>
  258. <% disabled = hash[:locked] && hash[:inherited] %>
  259. <tr>
  260. <td colspan="2"><%= r.check_box :value, :checked => hash[:value], :disabled => disabled %>
  261. <%= r.label :value, :en => "Disable comments on announcements" %>
  262. </td>
  263. </tr>
  264. <% unless disabled %>
  265. <tr>
  266. <td colspan="2" class="sub_checkbox">
  267. <%= r.check_box :locked, :checked => hash[:locked] %>
  268. <%= r.label :locked, :en => "Lock this setting for sub-accounts and courses" %>
  269. </td>
  270. </tr>
  271. <% end %>
  272. <% end %>
  273. <%= settings.fields_for :enable_offline_web_export do |r| %>
  274. <% hash = @account.enable_offline_web_export %>
  275. <% disabled = hash[:locked] && hash[:inherited] %>
  276. <tr>
  277. <td colspan="2">
  278. <%= r.check_box :value, checked: hash[:value], disabled: disabled %>
  279. <%= r.label :value, t("Allow students to download course content and view offline") %>
  280. </td>
  281. </tr>
  282. <% end %>
  283. <% end %>
  284. <% end %>
  285. </table>
  286. </fieldset>
  287. <%= render partial: 'additional_settings', locals: { f: f } %>
  288. <% if !@account.site_admin? && @account.root_account? && @account.grants_right?(@current_user, :manage_site_settings) %>
  289. <% TermsOfService.ensure_terms_for_account(@account) %>
  290. <% js_env(:TERMS_OF_SERVICE_CUSTOM_CONTENT => @account.terms_of_service_content&.content) %>
  291. <% js_bundle :terms_of_service_modal%>
  292. <fieldset>
  293. <legend>{{#t}}Terms of Service{{/t}}</legend>
  294. <%= f.fields_for :terms_of_service do |tos| %>
  295. <%= tos.label :terms_type, t("License Type") %>
  296. <%= tos.select :terms_type, options_for_select(TermsOfService.type_dropdown_options, @account.terms_of_service.terms_type) %>
  297. <br>
  298. <%= tos.check_box :passive, :checked => @account.terms_of_service.passive %>
  299. <%= tos.label :passive, t("Allow passive acceptance of Terms of Service")%>
  300. <% end %>
  301. </fieldset>
  302. <div id="custom_tos_rce_container" style="<%= hidden %>">
  303. <textarea name="account[terms_of_service][content]"></textarea>
  304. </div>
  305. <div id="terms_of_service_preview_link"></div>
  306. <% end %>
  307. <% if !@account.site_admin? &&
  308. @account.root_account? &&
  309. @account.feature_enabled?(:google_docs_domain_restriction) &&
  310. @account.grants_right?(@current_user, :manage_site_settings) %>
  311. <fieldset id="google-docs-domain">
  312. <legend>{{#t}}Allowed Google Docs Domain{{/t}}</legend>
  313. <%= f.fields_for :settings do |settings| %>
  314. <%= settings.label :google_docs_domain, t('labels.domain', 'Domain:') %>
  315. <%= settings.text_field :google_docs_domain, placeholder: 'gmail.com', value: @account.settings[:google_docs_domain] %>
  316. <% end %>
  317. </fieldset>
  318. <% end %>
  319. <% unless @account.site_admin? %>
  320. <fieldset>
  321. <h2 class="screenreader-only">{{#t}}Quiz IP Address Filters{{/t}}</h2>
  322. <legend>{{#t}}Quiz IP Address Filters{{/t}}
  323. <button class='Button Button--icon-action ip_help_link' type='button'>
  324. <i class='icon-question'></i>
  325. <span class='screenreader-only'>{{#t}}What are Quiz IP Filters?{{/t}}</span>
  326. </button>
  327. </legend>
  328. <div id="ip_filters_dialog" style="display: none;">
  329. <h2>{{#t}}What are Quiz IP Filters?{{/t}}</h2>
  330. <%= mt(:quiz_ip_filters_help_message,
  331. "Quiz IP filters are a way to limit access to quizzes to computers in a specified IP range.\n\n" +
  332. "Specify a set of IP address filters that teachers can use to " +
  333. "protect access to quizzes. Filters can be a comma-separated " +
  334. "list of addresses, or an address followed by a mask " +
  335. "(\"192.168.217.1/24\" or \"192.168.217.1/255.255.255.0\").\"") %>
  336. </div>
  337. <table class="formtable">
  338. <tbody id="ip_filters">
  339. <% ((@account.settings[:ip_filters] || {}).sort_by(&:first) << [nil, nil]).each do |name, filter| %>
  340. <tr class="ip_filter <%= raw ' blank" style="display: none;' if name.nil? %>">
  341. <td> <label> {{#t}}Name:") %></label> <input aria-label="<%= t("Name{{/t}}" type="text" class="name" value="<%= name %>"/></td>
  342. <td> <label> {{#t}}Filter:") %></label> <input aria-label="<%= t("Filter{{/t}}" type="text" class="value" value="<%= filter %>" maxlength="255"/></td>
  343. <td>
  344. <a href="#" title="{{#t}}Remove Filter{{/t}}" class="delete_filter_link"><i class="icon-end standalone-icon"></i></a>
  345. </td>
  346. </tr>
  347. <% end %>
  348. </tbody>
  349. </table>
  350. <a href="#" class="icon-add add_ip_filter_link">
  351. <span aria-hidden="true">{{#t}}Filter{{/t}}</span>
  352. </a>
  353. </fieldset>
  354. <% end %>
  355. <fieldset>
  356. <h2 class="screenreader-only">{{#t}}Features{{/t}}</h2>
  357. <legend>{{#t}}Features{{/t}}</legend>
  358. <%= f.fields_for :settings do |settings| %>
  359. <% if @account.root_account? %>
  360. <% if @account.grants_right?(@current_user, :manage_site_settings) %>
  361. <div>
  362. <%= settings.check_box :admins_can_change_passwords, :checked => @account.settings[:admins_can_change_passwords] == true %>
  363. <%= settings.label :admins_can_change_passwords, :en => "Password setting by admins" %>
  364. </div>
  365. <div>
  366. <%= settings.check_box :admins_can_view_notifications, :checked => @account.settings[:admins_can_view_notifications] %>
  367. <%= settings.label :admins_can_view_notifications, :en => "Admins can view notifications" %>
  368. </div>
  369. <div>
  370. <%= settings.check_box :canvadocs_prefer_office_online, :checked => @account.settings[:canvadocs_prefer_office_online] %>
  371. <%= settings.label :canvadocs_prefer_office_online, :en => "Prefer Office 365 file viewer" %>
  372. </div>
  373. <% unless @account.site_admin? %>
  374. <div>
  375. <%= f.check_box :enable_user_notes, :checked => @account.enable_user_notes %>
  376. <%= f.label :enable_user_notes, :en => "Faculty Journal" %>
  377. </div>
  378. <div>
  379. <%= settings.check_box :enable_eportfolios, :checked => @account.settings[:enable_eportfolios] != false %>
  380. <%= settings.label :enable_eportfolios, :en => "ePortfolios" %>
  381. </div>
  382. <% if !@account.feature_enabled?(:new_sis_integrations) %>
  383. <div id="old_sis_integrations">
  384. <%= f.check_box :allow_sis_import, :checked => @account.allow_sis_import %>
  385. <%= f.label :allow_sis_import, t("SIS imports") %>
  386. </div>
  387. <% end %>
  388. <div>
  389. <%= settings.check_box :allow_invitation_previews, :checked => @account.settings[:allow_invitation_previews] %>
  390. <%= settings.label :allow_invitation_previews, :en => "Invitation Previews" %>
  391. </div>
  392. <div>
  393. <%= settings.check_box :enable_alerts, :checked => @account.settings[:enable_alerts] %>
  394. <%= settings.label :enable_alerts, :en => "Alerts (beta)" %>
  395. </div>
  396. <% end %>
  397. <%# end of site_admin? %>
  398. <div id="global_includes_warning_message_wrapper">
  399. <%= settings.check_box :global_includes, :checked => @account.settings[:global_includes] %>
  400. <%= settings.label :global_includes, :en => "Custom CSS/JavaScript overrides" %>
  401. <div id="global_includes_warning_message" class="account_settings__help-text">
  402. <p>
  403. {{#t}}Custom CSS and Javascript may cause accessibility issues or conflicts with future Canvas updates!{{/t}}
  404. </p>
  405. <p>
  406. <%= t do %>
  407. Before implementing custom CSS or Javascript, please refer to <a href="https://community.canvaslms.com/docs/DOC-3010" target="_blank"> our documentation</a>.
  408. <% end %>
  409. </p>
  410. </div>
  411. </div>
  412. <div id="show_scheduler_checkbox">
  413. <%= settings.check_box :show_scheduler, :checked => @account.settings[:show_scheduler] %>
  414. <%= settings.label :show_scheduler, :en => "Enable Scheduler" %>
  415. </div>
  416. <div>
  417. <%= settings.check_box :enable_profiles, :checked => @account.settings[:enable_profiles] %>
  418. <%= settings.label :enable_profiles, :en => "Enable Profiles" %>
  419. </div>
  420. <% end %>
  421. <%# end of :manage_site_settings %>
  422. <div>
  423. <%= settings.check_box :sub_account_includes, checked: @account.settings[:sub_account_includes] %>
  424. <%= settings.label :sub_account_includes, :en => "Let sub-accounts use the Theme Editor to customize their own branding" %>
  425. </div>
  426. <% if @account.canvas_authentication? %>
  427. <div>
  428. <%= settings.check_box :open_registration, :checked => @account.open_registration? %>
  429. <%= settings.label :open_registration, :en => "Open Registration" %>
  430. <% if @account.delegated_authentication? %>
  431. <legend>
  432. <%= link_to(image_tag('warning.png', :alt => ''), '#',
  433. :class => 'open_registration_delegated_warning_link no-hover',
  434. :title => t(:open_registration_delegated_warning_tooltip,
  435. "An External Identity Provider is Enabled"))
  436. %>
  437. </legend>
  438. <div id="open_registration_delegated_warning_dialog" style="display: none;">
  439. <%= t(:open_registration_delegated_warning_message,
  440. "An external identity provider is enabled, and users created via open registration may not be able to log in unless
  441. the external identity provider's login form has a link back to %{url}.", :url => canvas_login_url) %>
  442. </div>
  443. <% end %>
  444. </div>
  445. <% end %>
  446. <div>
  447. <%= settings.check_box :users_can_edit_name, :checked => @account.settings[:users_can_edit_name] != false %>
  448. <%= settings.label :users_can_edit_name, :en => "Users can edit their name" %>
  449. </div>
  450. <div>
  451. <%= settings.check_box :edit_institution_email, :checked => @account.edit_institution_email? %>
  452. <%= settings.label :edit_institution_email, :en => "Users can delete their institution-assigned email address" %>
  453. </div>
  454. <div>
  455. <%= settings.check_box :author_email_in_notifications, :checked => @account.author_email_in_notifications? %>
  456. <%= settings.label :author_email_in_notifications, :en => "Show the email address of sender for user interaction Notifications" %>
  457. </div>
  458. <% end %>
  459. <% unless @account.site_admin? %>
  460. <div>
  461. <input type="checkbox" id="enable_equella" <%= 'checked' if !@account.settings[:equella_endpoint].blank? %> />
  462. <label for="enable_equella"><%= t 'labels.equella', 'Equella' %></label>
  463. </div>
  464. <% end %>
  465. <% if @account.grants_right?(@current_user, :manage_site_settings) %>
  466. <div>
  467. <%= settings.check_box :enable_turnitin, :checked => @account.settings[:enable_turnitin] %>
  468. <%= settings.label :enable_turnitin, :en => "Turnitin" %>
  469. </div>
  470. <% end %>
  471. <% end %>
  472. <%= f.fields_for :services do |services| %>
  473. <% Account.services_exposed_to_ui_hash(:setting, @current_user, @account).sort_by { |k,h| Canvas::ICU.collation_key(h[:name]) }.each do |key, service| %>
  474. <div>
  475. <%= services.check_box key, :checked => @account.service_enabled?(key) %>
  476. <%= services.label key, service[:name] + " " %>
  477. </div>
  478. <% end %>
  479. <% end %>
  480. </fieldset>
  481. <% unless @account.site_admin? %>
  482. <% if @account.feature_enabled?(:new_sis_integrations) %>
  483. <%= render partial: 'sis_integration_settings', locals: { f: f } %>
  484. <% else %>
  485. <%= render partial: 'sis_integration_settings_old', locals: { f: f } %>
  486. <% end %>
  487. <% end %>
  488. <% if @account.root_account? && !@account.site_admin? && show_feedback_link? %>
  489. <div id="custom_help_link_settings"></div>
  490. <% end %>
  491. <% unless @account.site_admin? %>
  492. <fieldset id="enable_equella_settings" style="display: none;">
  493. <legend>{{#t}}Equella Settings{{/t}}</legend>
  494. <%= f.fields_for :settings do |settings| %>
  495. <table class="formtable">
  496. <tr>
  497. <td style="vertical-align: top;"><%= settings.label :equella_endpoint, :en => "Equella Endpoint" %></td>
  498. <td>
  499. <%= settings.text_field :equella_endpoint, :value => @account.settings[:equella_endpoint] %>
  500. <div style="font-size: 0.9em;">{{#t}}This is the URL to your equella service. It will probably look something like \"%{sample_url}\".", :sample_url => "http://oer.equella.com/signon.do{{/t}}</div>
  501. </td>
  502. </tr>
  503. <tr>
  504. <td><%= settings.blabel :equella_teaser, :en => "Equella Comments" %></td>
  505. <td><%= settings.text_area :equella_teaser, :style => "width: 90%; height: 75px;", :value => @account.settings[:equella_teaser] %></td>
  506. </tr>
  507. </table>
  508. <% end %>
  509. </fieldset>
  510. <% if @account.feature_enabled?(:plagiarism_detection_platform) || @account.settings[:enable_turnitin] %>
  511. <fieldset id="turnitin_settings">
  512. <legend>{{#t}}Similarity Detection Platform{{/t}}</legend>
  513. <table class="formtable">
  514. <tr>
  515. <td><%= f.blabel :turnitin_pledge, en: "Similarity Pledge" %></td>
  516. <td>
  517. <span style="font-size: 0.9em;">
  518. {{#t}}students must check a box acknowledging that they agree with this pledge{{/t}}
  519. </span>
  520. <%= f.text_area :turnitin_pledge, :style => "width: 90%; height: 50px;" %>
  521. </td>
  522. </tr>
  523. </table>
  524. </fieldset>
  525. <% end %>
  526. <% if @account.settings[:enable_turnitin] %>
  527. <fieldset id="turnitin_settings">
  528. <legend>{{#t}}Turnitin Settings{{/t}}</legend>
  529. <table class="formtable">
  530. <tr>
  531. <td><%= f.blabel :turnitin_account_id, :en => "Turnitin Account ID" %></td>
  532. <td><%= f.text_field :turnitin_account_id, :class => "turnitin_account_settings" %></td>
  533. </tr>
  534. <tr>
  535. <td><%= f.blabel :turnitin_shared_secret, :en => "Turnitin Shared Secret" %></td>
  536. <td><%= f.text_field :turnitin_shared_secret, :class => "turnitin_account_settings" %></td>
  537. </tr>
  538. <tr>
  539. <td><%= f.blabel :turnitin_host, :en => "Turnitin Host" %></td>
  540. <td><%= f.text_field :turnitin_host, :class => "turnitin_account_settings", :placeholder => "api.turnitin.com" %></td>
  541. </tr>
  542. <tr>
  543. <td>&nbsp;</td>
  544. <td>
  545. <a href="<%= account_turnitin_confirmation_path(@account) %>" class="confirm_turnitin_settings_link Button">
  546. {{#t}}confirm Turnitin settings{{/t}}
  547. </a>
  548. </td>
  549. </tr>
  550. <tr>
  551. <td><%= f.blabel :turnitin_comments, :en => "Submission Comments" %></td>
  552. <td>
  553. <span style="font-size: 0.9em;">{{#t}}these comments will be shown to students when submitting a Turnitin-enabled assignment{{/t}}</span>
  554. <%= f.text_area :turnitin_comments, :style => "width: 90%; height: 50px;" %>
  555. </td>
  556. </tr>
  557. <tr>
  558. <td><%= f.blabel :originality_report_visibility, :en => "Students can see the originality report" %></td>
  559. <td>
  560. <%= f.select :turnitin_originality, options_for_select(turnitin_originality_options, @account.turnitin_originality)%>
  561. </td>
  562. </tr>
  563. </table>
  564. </fieldset>
  565. <% end %>
  566. <% end %>
  567. <% if @account.root_account? and not (exposed_services = Account.services_exposed_to_ui_hash(:service, @current_user)).empty? %>
  568. <fieldset>
  569. <h2 class="screenreader-only">{{#t}}Enabled Web Services{{/t}}</h2>
  570. <legend>{{#t}}Enabled Web Services{{/t}}</legend>
  571. <%= f.fields_for :services do |services| %>
  572. <% exposed_services.sort_by { |k,h| Canvas::ICU.collation_key(h[:name]) }.each do |key, service| %>
  573. <div>
  574. <%= services.check_box key, :checked => @account.service_enabled?(key) %>
  575. <%= services.label key, service[:name] + " " %>
  576. </div>
  577. <% end %>
  578. <% end %>
  579. <div style="display:none;">
  580. <!-- put all of the helpful dialogs describing what each service does in here
  581. the magic is in giving it an id of "<name_of_service>_help_dialog" and class="service_help_dialog" -->
  582. <div class="service_help_dialog" title="{{#t}}About Google Docs Previews{{/t}}" id="google_docs_previews_help_dialog">
  583. <%= mt(:about_google_docs, <<-TEXT, :terms_url => "https://docs.google.com/viewer/TOS")
  584. Google Docs Previews allow users to view documents from
  585. within Canvas, rather than having to download them and
  586. open the corresponding program (e.g. Word or Excel).
  587. Google Docs Previews can also render file types
  588. not supported by the Canvas document previewer.
  589. By using this service you
  590. acknowledge that you have read and agreed to the
  591. [Google Docs Viewer Terms of Service](%{terms_url}).
  592. TEXT
  593. %>
  594. </div>
  595. </div>
  596. </fieldset>
  597. <% end %>
  598. <% if @account.root_account? && !@account.site_admin? %>
  599. <fieldset>
  600. <h2 class="screenreader-only">{{#t}}Who Can Create New Courses{{/t}}</h2>
  601. <legend>{{#t}}Who Can Create New Courses{{/t}}</legend>
  602. <div style="font-size: 0.8em;">{{#t}}(Account Administrators can always create courses){{/t}}</div>
  603. <%= f.fields_for :settings do |settings| %>
  604. <div>
  605. <%= settings.check_box :teachers_can_create_courses, :checked => @account.teachers_can_create_courses? %>
  606. <%= settings.label :teachers_can_create_courses, :en => "Teachers" %>
  607. </div>
  608. <div>
  609. <%= settings.check_box :no_enrollments_can_create_courses, :checked => @account.no_enrollments_can_create_courses? %>
  610. <%= settings.label :no_enrollments_can_create_courses, :en => "Users with no enrollments" %>
  611. </div>
  612. <div>
  613. <%= settings.check_box :students_can_create_courses, :checked => @account.students_can_create_courses? %>
  614. <%= settings.label :students_can_create_courses, :en => "Students" %>
  615. </div>
  616. <% end %>
  617. </fieldset>
  618. <% end %>
  619. <%= render partial: 'external_integration_keys', locals: { f: f } %>
  620. <div class="button-container">
  621. <button type="submit" class="Button Button--primary">{{#t}}Update Settings{{/t}}</button>
  622. </div>
  623. <% end %>
  624. </div>
  625. <% end %>
  626. <% if can_do(@context, @current_user, :manage_storage_quotas) %>
  627. <div id="tab-quotas">
  628. <h2 class="screenreader-only">{{#t}}Account Quotas{{/t}}</h2>
  629. </div>
  630. <% end %>
  631. <% if can_do(@context, @current_user, :manage_account_settings) && @account.root_account? && !@account.site_admin? %>
  632. <div id="tab-notifications">
  633. <%= form_for :account, :url => account_url(@account), :html => {:method => :put, :id => "account_settings_notifications"} do |f| %>
  634. <h2>{{#t}}E-mail Notification "From" Settings{{/t}}</h2>
  635. <p>{{#t}}This setting allows the Admin to brand or label the 'From' text on all notifications sent from Canvas for this Account.{{/t}}</p>
  636. <%= f.fields_for :settings do |settings| %>
  637. <div>
  638. <%= settings.radio_button :outgoing_email_default_name_option, 'default',
  639. :checked => @account.settings[:outgoing_email_default_name].blank?,
  640. :class => 'notification_from_name_option' %>
  641. <%= settings.label :outgoing_email_default_name_option_default, :en => "Default Canvas Setting" %>
  642. </div>
  643. <div style='padding-left: 2em;'>
  644. <strong><%= t 'notifications.example', 'Example:' %></strong>
  645. <blockquote>
  646. <table class="formtable" style='margin-left: 1.5em;'>
  647. <tr>
  648. <td><%= t 'notifications.from', 'From' %></td>
  649. <td><%= HostUrl.outgoing_email_default_name %> <%= '<notifications@instructure.com>' %></td>
  650. </tr>
  651. <tr>
  652. <td><%= t 'notifications.subject', 'Subject' %></td>
  653. <td><%= t 'notifications.sample_subject', 'Recent Canvas Notifications' %></td>
  654. </tr>
  655. <tr>
  656. <td><%= t 'notifications.email_date', 'Date' %></td>
  657. <td><%= datetime_string(Time.zone.now) %></td>
  658. </tr>
  659. <tr>
  660. <td><%= t 'notifications.email_to', 'To' %></td>
  661. <td><%= 'recipient@instructure.com' %></td>
  662. </tr>
  663. <tr>
  664. <td><%= t 'notifications.email_reply_to', 'Reply-To' %></td>
  665. <td><%= 'notifications+e79df3ljk09s3jkl09ssljk3lkj2l-10191633@instructure.com' %></td>
  666. </tr>
  667. </table>
  668. </blockquote>
  669. </div>
  670. <div>
  671. <%= settings.radio_button :outgoing_email_default_name_option, 'custom',
  672. :checked => !@account.settings[:outgoing_email_default_name].blank?,
  673. :class => 'notification_from_name_option' %>
  674. <%= settings.label :outgoing_email_default_name_option_custom, :en => 'Custom "From" Name' %>
  675. </div>
  676. <div style='padding-left: 2em;'>
  677. <p>
  678. {{#t}}If selected, this will replace all other branding sent in Canvas notifications.{{/t}}
  679. <br/>
  680. <%= text_field_tag 'account[settings][outgoing_email_default_name]', @account.settings[:outgoing_email_default_name] %>
  681. </p>
  682. </div>
  683. <div style='padding-left: 2em;'>
  684. <strong><%= t 'notifications.example', 'Example:' %></strong>
  685. <blockquote>
  686. <table class="formtable" style='margin-left: 1.5em;'>
  687. <tr>
  688. <td><%= t 'notifications.from', 'From' %></td>
  689. <td><strong id='custom_default_name_display'></strong> <%= '<notifications@instructure.com>' %></td>
  690. </tr>
  691. <tr>
  692. <td><%= t 'notifications.subject', 'Subject' %></td>
  693. <td><%= t 'notifications.sample_subject', 'Recent Canvas Notifications' %></td>
  694. </tr>
  695. <tr>
  696. <td><%= t 'notifications.email_date', 'Date' %></td>
  697. <td><%= datetime_string(Time.zone.now) %></td>
  698. </tr>
  699. <tr>
  700. <td><%= t 'notifications.email_to', 'To' %></td>
  701. <td><%= 'recipient@instructure.com' %></td>
  702. </tr>
  703. <tr>
  704. <td><%= t 'notifications.email_reply_to', 'Reply-To' %></td>
  705. <td><%= 'notifications+e79df3ljk09s3jkl09ssljk3lkj2l-10191633@instructure.com' %></td>
  706. </tr>
  707. </table>
  708. </blockquote>
  709. </div>
  710. <h2>{{#t}}Notifications Sent to External Services{{/t}}</h2>
  711. <table class="formtable">
  712. <tr>
  713. <td><input type="checkbox" id="account_settings_external_notification_warning_checkbox" <%= 'checked="checked"' if @account.settings[:external_notification_warning] %> /></td>
  714. <td>
  715. <label for="account_settings_external_notification_warning_checkbox">{{#t}}Display one time pop-up warning on Notification Preferences page.{{/t}}</label>
  716. <input type="hidden" name="account[settings][external_notification_warning]" id="account_settings_external_notification_warning" value="<%= @account.settings[:external_notification_warning] ? 1 : 0 %>" />
  717. </td>
  718. </tr>
  719. </table>
  720. <table style="margin-left: 1.5em;" cellspacing="0" class="formtable">
  721. <tr>
  722. <td>
  723. <b>{{#t}}Pop-up Message Content:{{/t}}</b>
  724. <blockquote>{{#t}}Notice: Some notifications may contain confidential information. Selecting to receive notifications at an email other than your institution provided address may result in sending sensitive Canvas course and group information outside of the institutional system.{{/t}}</blockquote>
  725. </td>
  726. </tr>
  727. </table>
  728. <% end %>
  729. <div class="button-container">
  730. <button type="submit" class="Button Button--primary">{{#t}}Update Settings{{/t}}</button>
  731. </div>
  732. <% end %>
  733. </div>
  734. <% end %>
  735. <div id="tab-users">
  736. <h2>{{#t}}Account Admins{{/t}}</h2>
  737. <ul class="admins_list user_list list admins">
  738. {{> views/account_user}}
  739. <% available_roles = @context.available_account_roles(false, @current_user) %>
  740. <% unless available_roles.empty? %>
  741. {{> views/account_user}}
  742. <% end %>
  743. </ul>
  744. <% unless available_roles.empty? %>
  745. <% js_bundle :user_lists %>
  746. <a href="#" class="add_users_link Button Button--primary" title="{{#t}}Add Account Admins') %>" aria-label="{{#t}}Account Admins{{/t}}</a>
  747. <%= form_tag account_add_account_user_url(@account), {:id => "enroll_users_form", :style => "display: none;"} do %>
  748. <h2>{{#t}}Add Account Admins{{/t}}</h2>
  749. <div style="margin-top: 5px;">
  750. <div>
  751. <%= label_tag :role_id, t("Add More") %>
  752. <select name="role_id" id="admin_role_id">
  753. <% available_roles.each do |role| %>
  754. <option value="<%= role.id %>"><%= AccountUser.readable_type(role.name) %></option>
  755. <% end %>
  756. </select>
  757. </div>
  758. {{> views/shared/user_lists}}
  759. </div>
  760. <div class="form-actions">
  761. <button type="button" class="Button go_back_button">{{#t}}Go back and edit the list of users{{/t}}</button>
  762. <button type="button" class="Button cancel_button">{{#t}}Cancel{{/t}}</button>
  763. <button type="button" class="Button Button---primary verify_syntax_button">{{#t}}Continue...{{/t}}</button>
  764. <button type="submit" class="Button Button--primary add_users_button">{{#t}}OK Looks Good, Add These Users{{/t}}</button>
  765. </div>
  766. <% end %>
  767. <% end %>
  768. </div>
  769. <div id="tab-announcements">
  770. <h2>{{#t}}Global Announcements{{/t}}</h2>
  771. <ul class="announcements_list unstyled_list">
  772. <%= will_paginate(@announcements, params: {anchor: "tab-announcements"}) %>
  773. <% @announcements.each do |announcement| %>
  774. <li class="announcements_list_item">
  775. <div class="ic-notification ic-notification--admin-created ic-notification--<%= notification_container_classname(announcement) %>">
  776. <div class="ic-notification__icon" role="presentation">
  777. <i class="<%= notification_icon_classname(announcement) %>"></i>
  778. <span class="screenreader-only">
  779. <%= accessible_message_icon_text(notification_icon_type(announcement)) %>
  780. </span>
  781. </div>
  782. <div class="notification_account_content">
  783. <div class="ic-notification__content">
  784. <div class="ic-notification__message">
  785. <h4 class="ic-notification__title notification_subject">
  786. <%= announcement.subject %>
  787. </h4>
  788. <span class="notification_message">
  789. <%= user_content(announcement.message) %>
  790. </span>
  791. <% if can_do(@account, @current_user, :manage_alerts) %>
  792. <div class="ic-notification__admin-actions">
  793. <button
  794. id="<%= "notification_edit_#{announcement.id}" %>"
  795. class="Button Button--icon-action element_toggler edit_notification_toggle_focus"
  796. aria-controls="<%= "edit_notification_form_#{announcement.id}" %>"
  797. data-edit-toggle-id="<%= announcement.id %>"
  798. >
  799. <i class="icon-edit"></i>
  800. </button>
  801. <a href="#" rel="<%= context_url(@account, :context_account_notification_url, announcement) %>" class="Button Button--icon-action delete_notification_link" title="<%= t("Delete announcement %{title}", :title => announcement.subject) %>">
  802. <i class="icon-trash"></i>
  803. </a>
  804. </div>
  805. <% end %>
  806. </div>
  807. </div>
  808. <span class="notification_account_content_text">
  809. <%= t("This is a message for *%{name}*", name: announcement.account.name, wrapper: '<b>\1</b>') %>
  810. </span>
  811. </div>
  812. </div>
  813. <div class="announcement-details">
  814. <div class="announcement-details-post-info">
  815. <div class="announcement-details-post-info__datetime">
  816. <%= t(:alert_timespan, "from %{start_at} to %{end_at}",
  817. :start_at => datetime_string(announcement.start_at),
  818. :end_at => datetime_string(announcement.end_at)) %>
  819. </div>
  820. <div class="announcement-details-post-info__sender">
  821. <%= link_to(context_user_name(@account, announcement.user_id), user_path(announcement.user_id)) %>
  822. </div>
  823. </div>
  824. <% if announcement.required_account_service %>
  825. <div>
  826. <%= AccountServices.allowable_services[announcement.required_account_service.to_sym].try(:[], :name) %>
  827. </div>
  828. <% end %>
  829. <% unless announcement.account_notification_roles.empty? %>
  830. <div class="announcement-details-roles">
  831. <%= t "Send only to the following types of users:" %>
  832. <%= roles_message(@account) %>
  833. <ul>
  834. <% announcement.account_notification_roles.each do |r| %>
  835. <% @course_roles.select {|rt| rt[:id] == r.role_id }.each do |rt| %>
  836. <li><%= rt[:label] %></li>
  837. <% end %>
  838. <% # NilEnrollment is a special case %>
  839. <% if r.role_id.nil? %>
  840. <li><%= t :no_enrollment_roles, "Unenrolled users" %></li>
  841. <% end %>
  842. <% @account_roles.select {|rt| rt[:id] == r.role_id }.each do |rt| %>
  843. <li><%= rt[:label] %></li>
  844. <% end %>
  845. <% end %>
  846. </ul>
  847. </div>
  848. <% end %>
  849. <% if announcement.months_in_display_cycle %>
  850. <div>
  851. <%= t :announcement_sent_to_subset, "Sent to 1 / %{denominator} users each month", denominator: announcement.months_in_display_cycle %>
  852. </div>
  853. <% end %>
  854. <% if can_do(@account, @current_user, :manage_alerts) %>
  855. <%= render(:partial => "edit_account_notification", :locals => {:announcement => announcement}) %>
  856. <% end %>
  857. </div>
  858. </li>
  859. <% end %>
  860. </ul>
  861. <% if can_do(@account, @current_user, :manage_alerts) %>
  862. <button id="add_announcement_button" class="Button Button--primary element_toggler add_notification_toggle_focus" aria-controls="add_notification_form" title="{{#t}}Add New Announcement') %>" aria-label="<%= t('Add New Announcement{{/t}}">
  863. <i class="icon-plus"></i> {{#t}}New Announcement{{/t}}
  864. </button>
  865. <%= form_for :account_notification,
  866. url: account_account_notifications_url(@account),
  867. html: {
  868. id: "add_notification_form",
  869. class: "hidden_form",
  870. role: "region" } do |f| %>
  871. <div class="grid-row">
  872. <div class="col-xs-12 col-lg-6">
  873. <div class="ic-Form-control">
  874. <label for="account_notification_subject" class="ic-Label">
  875. {{#t}}Title{{/t}}
  876. </label>
  877. <%= f.text_field :subject, :class => 'ic-Input', :id => 'account_notification_subject' %>
  878. </div>
  879. </div>
  880. <div class="col-xs-12 col-lg-6">
  881. <div class="ic-Form-control">
  882. <label for="account_notification_icon" class="ic-Label">
  883. {{#t}}Announcement type{{/t}}
  884. </label>
  885. <select
  886. id="account_notification_icon"
  887. class="ic-Input"
  888. name="account_notification[icon]"
  889. >
  890. <%= options_for_select([[t("information"), "information", {:class=>"information"}],
  891. [t("error"), "error", {:class=>"error"}],
  892. [t("warning"), "warning", {:class=>"warning"}],
  893. [t("question"), "question", {:class=>"question"}],
  894. [t("calendar"), "calendar", {:class=>"calendar"}]]) %>
  895. </select>
  896. </div>
  897. </div>
  898. </div>
  899. <div class="ic-Form-control">
  900. <label class="ic-Label">{{#t}}Message{{/t}}</label>
  901. <%= f.text_area :message, :class => 'alert_message' %>
  902. <% if @account.site_admin? %>
  903. <p>
  904. {{#t}}Enter \"{{ACCOUNT_DOMAIN}}\" to substitute the user's root account domain{{/t}}
  905. </p>
  906. <p>
  907. {{#t}}Enter \"{{CANVAS_USER_ID}}\" to substitute the user's unique Canvas ID{{/t}}
  908. </p>
  909. <% end %>
  910. </div>
  911. <% if @account.site_admin? %>
  912. <div class="ic-Checkbox-group">
  913. <div class="ic-Form-control ic-Form-control--checkbox">
  914. <div id="survey_announcement_field">
  915. <input type="checkbox" name="account_notification[required_account_service]" id="account_notification_required_account_service" value="account_survey_notifications" />
  916. <label class="ic-Label" for="account_notification_required_account_service">
  917. <%= t "Site Admin Only. Send to 1 / %{denominator} users in enabled accounts each month.", denominator: f.text_field(:months_in_display_cycle, value: AccountNotification.default_months_in_display_cycle, disabled: true) %>
  918. </label>
  919. </div>
  920. </div>
  921. </div>
  922. <% end %>
  923. <div class="ic-Form-control">
  924. <div class="ic-Label" id="aria-announcements-send-to-group">
  925. <%= t "Send to" %>
  926. <%= roles_message(@account) %>
  927. </div>
  928. <div class="grid-row">
  929. <div class="col-xs-12 col-lg-4">
  930. <i><%= t "Course roles" %></i>
  931. <div class="ic-Checkbox-group" role="group" aria-labelledby="aria-announcements-send-to-group">
  932. <% @course_roles.each do |r| %>
  933. <div class="ic-Form-control ic-Form-control--checkbox">
  934. <%= check_box_tag "account_notification_roles[]", r[:id], false, { :class => "account_notification_role_cbx", :id => "account_notification_role_#{r[:id]}_cbx" } %>
  935. <label class="ic-Label" for="<%= "account_notification_role_#{r[:id]}_cbx" %>">
  936. <%= r[:label] %>
  937. <span class="screenreader-only">
  938. <%=t "Send this announcement to users with the course role of %{role}", :role => r[:label] %>
  939. </span>
  940. </label>
  941. </div>
  942. <% end %>
  943. <% if @account.root_account? %>
  944. <div class="ic-Form-control ic-Form-control--checkbox">
  945. <%= check_box_tag "account_notification_roles[]", "NilEnrollment", false, { :class => "account_notification_role_cbx", :id => "account_notification_role_NilEnrollment_cbx" } %>
  946. <label class="ic-Label" for="<%= "account_notification_role_NilEnrollment_cbx" %>">
  947. <%= t "Unenrolled users" %>
  948. <span class="screenreader-only">
  949. <%=t "Send this announcement to unenrolled users" %>
  950. </span>
  951. </label>
  952. </div>
  953. <% end %>
  954. </div>
  955. </div>
  956. <div class="col-xs-12 col-lg-4">
  957. <i><%= t "Account roles" %></i>
  958. <div class="ic-Checkbox-group" role="group" aria-labelledby="aria-announcements-send-to-group">
  959. <% @account_roles.each do |r| %>
  960. <div class="ic-Form-control ic-Form-control--checkbox">
  961. <%= check_box_tag "account_notification_roles[]", r[:id], false, { :class => "account_notification_role_cbx", :id => "account_notification_role_#{r[:id]}_cbx" } %>
  962. <label class="ic-Label" for="<%= "account_notification_role_#{r[:id]}_cbx" %>">
  963. <%= r[:label] %>
  964. <span class="screenreader-only">
  965. <%=t "Send this announcement to users with the account role of %{role}", :role => r[:label] %>
  966. </span>
  967. </label>
  968. </div>
  969. <% end %>
  970. </div>
  971. </div>
  972. </div>
  973. </div>
  974. <div class="grid-row">
  975. <div class="col-xs-12 col-lg-6">
  976. <div class="ic-Form-control">
  977. <label class="ic-Label" id="announcement_starts_at_label">
  978. {{#t}}Announcement starts at{{/t}}
  979. <span class="screenreader-only">
  980. <%= datepicker_screenreader_prompt %>
  981. </span>
  982. </label>
  983. <%= f.text_field :start_at,
  984. :class => 'datetime_field',
  985. "aria-labelledby" => "announcement_starts_at_label",
  986. "data-tooltip" => "",
  987. :title => accessible_date_format %>
  988. </div>
  989. </div>
  990. <div class="col-xs-12 col-lg-6">
  991. <div class="ic-Form-control">
  992. <label class="ic-Label" id="announcement_ends_at_label">
  993. {{#t}}Announcement ends at{{/t}}
  994. <span class="screenreader-only">
  995. <%= datepicker_screenreader_prompt %>
  996. </span>
  997. </label>
  998. <%= f.text_field :end_at,
  999. :class => 'datetime_field',
  1000. "aria-labelledby" => "announcement_ends_at_label",
  1001. "data-tooltip" => "",
  1002. :title => accessible_date_format %>
  1003. </div>
  1004. </div>
  1005. </div>
  1006. <div class="ic-Form-actions">
  1007. <button type="Button" class="element_toggler Button Button--secondary add_notification_cancel_focus" aria-controls="add_notification_form">
  1008. {{#t}}Cancel{{/t}}
  1009. </button>
  1010. <button type="submit" class="Button Button--primary">
  1011. {{#t}}Publish announcement{{/t}}
  1012. </button>
  1013. </div>
  1014. <% end %>
  1015. <% end %>
  1016. </div>
  1017. <% if !@available_reports.blank? %>
  1018. <div id="tab-reports">
  1019. <h2 class="screenreader-only">{{#t}}Reports{{/t}}</h2>
  1020. <table class="reports">
  1021. <tr class="reports">
  1022. <th class="reports"><%= t 'headers.report_name', 'Name' %></th>
  1023. <th class="reports"><%= t 'headers.report_last_run', 'Last Run' %></th>
  1024. <th class="reports"></th>
  1025. </tr>
  1026. <% @available_reports.sort_by {|_, details| details.title}.each do |report, details|
  1027. title = details.title
  1028. description_partial = details[:description_partial]
  1029. description_partial = report + '_description' if description_partial == true
  1030. parameters_partial = details[:parameters_partial]
  1031. parameters_partial = report + '_parameters' if parameters_partial == true
  1032. last_complete = @last_complete_reports[report]
  1033. last_report = @last_reports[report]
  1034. in_progress = last_report && last_report.in_progress?
  1035. #the extra text is added so that you can give more than the date for the last run report
  1036. extra_text = last_complete.try(:parameters).try(:[], "extra_text")
  1037. %>
  1038. <tr id="<%= report %>" class="reports">
  1039. <td class="title reports">
  1040. <span class="title"><%= title %></span>
  1041. <% if description_partial %>
  1042. <a href="#" class="open_report_description_link" role="button" aria-haspopup="true" aria-owns="<%= "#{report}_report_description" %>">
  1043. <i class="icon-question standalone-icon"></i>
  1044. </a>
  1045. <div id="<%= "#{report}_report_description" %>" style="display: none" class="report_description">
  1046. <%= render(:partial => description_partial) %>
  1047. </div>
  1048. <% end %>
  1049. </td>
  1050. <td class="last-run reports">
  1051. <% if last_complete %>
  1052. <%= datetime_string(last_complete.created_at) %>
  1053. <%#the extra text is added so that you can give more than the date for the last run report %>
  1054. <% if extra_text %>
  1055. (<%= extra_text %>)
  1056. <% end %>
  1057. <% if last_complete.workflow_state == 'complete' %>
  1058. <%= link_to "<i class='icon-download'></i>".html_safe, context_url(last_complete.account, :context_file_download_url, last_complete.attachment.id), 'aria-label' => t('Download Report'), 'title' => t('Download Report') %>
  1059. <% end %>
  1060. <% else %>
  1061. <%= t 'report_last_run_never', 'Never' %>
  1062. <% end %>
  1063. </td>
  1064. <td class="action reports">
  1065. <% if parameters_partial %>
  1066. <div style="display: none">
  1067. <div class="report_dialog">
  1068. <form id="<%= report %>_form" class="run_report_form" action="<%= api_v1_account_create_report_path(@account, report) %>">
  1069. <div class="report_parameters">
  1070. <%= render :partial => parameters_partial if parameters_partial %>
  1071. </div>
  1072. <br />
  1073. <a href="#" id="run_<%= report %>" class="Button Button--primary Button--small run_report_link"><%= t 'links.run_report', 'Run Report' %></a>
  1074. </form>
  1075. </div>
  1076. </div>
  1077. <span class="running_report_message" style="<%= hidden unless in_progress %>">
  1078. {{#t}}The report is running.*You\'ll receive an email when it is done.*', :wrapper => '<div>\1</div>{{/t}}
  1079. </span>
  1080. <a href="#" id="configure_<%= report %>" style="<%= hidden if in_progress %>" class="Button Button--small configure_report_link"><%= t 'links.configure_report', 'Configure...' %></a>
  1081. <% else %>
  1082. <form id="<%= report %>_form" class="run_report_form" action="<%= api_v1_account_create_report_path(@account, report) %>">
  1083. <span class="running_report_message" style="<%= hidden unless in_progress %>">
  1084. {{#t}}The report is running.*You\'ll receive an email when it is done.*', :wrapper => '<div>\1</div>{{/t}}
  1085. </span>
  1086. <a href="#" id="run_<%= report %>" style="<%= hidden if in_progress %>" class="Button Button--small Button--primary run_report_link"><%= t 'links.run_report', 'Run Report' %></a>
  1087. </form>
  1088. <% end %>
  1089. </td>
  1090. </tr>
  1091. <% end %>
  1092. </table>
  1093. </div>
  1094. <% end %>
  1095. <% if can_do(@context, @current_user, :read_as_admin) %>
  1096. <div id="tab-tools">
  1097. {{> views/external_tools/external_tools}}
  1098. </div>
  1099. <% end %>
  1100. <% if @context.root_account.settings[:enable_alerts] && can_do(@context, @current_user, :manage_interaction_alerts) %>
  1101. <div id="tab-alerts">
  1102. <h2>{{#t}}Alerts{{/t}}</h2>
  1103. {{> views/alerts/alerts}}
  1104. </div>
  1105. <% end %>
  1106. <% if can_do(@context, @current_user, :manage_feature_flags) %>
  1107. <div id="tab-features"></div>
  1108. <% end %>
  1109. </div>