%
# 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 .
%>
<% css_bundle :alerts %>
<% js_bundle :alerts %>
<%=
if @context.is_a? Course
t(:alerts_description_course,
'An alert is generated for each student that meets all of the criteria. They are ' +
'checked every day, and notifications will be sent to the student and/or the ' +
'teacher until the triggering problem is resolved.')
else
t(:alerts_description_account,
'An alert is generated for each student that meets all of the criteria. They are ' +
'checked every day, and notifications will be sent to the student, teacher, and/or ' +
'account admin until the triggering problem is resolved.')
end
%>
<%
count = "%{count}" # we'll replace this with an input in js-land
alert_data = {
:DATA => @alerts,
:POSSIBLE_RECIPIENTS_ORDER => [':student', ':teachers'],
:POSSIBLE_RECIPIENTS => {
':student' => {:label => t(:the_student, "The Student")},
':teachers' => {:label => t(:the_teacher, "The Teacher")}
},
:POSSIBLE_CRITERIA_ORDER => ['Interaction', 'UngradedCount', 'UngradedTimespan'],
:POSSIBLE_CRITERIA => {
:Interaction => {
:label => t(:description, "A teacher has not interacted with the student for %{count} days", :count => count),
:option => t(:option, "No Teacher Interaction"),
:title => t(:title, "Days since a teacher has interacted with the student"),
:default_threshold => 7
},
:UngradedCount => {
:label => t(:ungraded_count_description, "More than %{count} submissions have not been graded", :count => count),
:option => t(:ungraded_count_option, "Ungraded Submissions (Count)"),
:title => t(:ungraded_count_title, "Number of submissions that have not been graded"),
:default_threshold => 3
},
:UngradedTimespan => {
:label => t(:ungraded_timespan_description, "A submission has been left ungraded for %{count} days", :count => count),
:option => t(:ungraded_timespan_option, "Ungraded Submissions (Time)"),
:title => t(:ungraded_timespan_title, "Days that a submission has been left ungraded"),
:default_threshold => 7
}
}
}
(@account_roles || []).each do |role|
alert_data[:POSSIBLE_RECIPIENTS_ORDER] << role[:id]
alert_data[:POSSIBLE_RECIPIENTS][role[:id]] = {:label => role[:label]}
end
js_env :ALERTS => alert_data
%>