forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalert.summary.erb
28 lines (27 loc) · 1.77 KB
/
alert.summary.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<% define_content :link do %>
<%= course_url asset_context.course_id %>
<% end %>
<% define_content :subject do %>
<%= t('subject', 'Alert: %{user_name}', :user_name => asset_context.user.name) %>
<% end %>
<%=
if asset_context.user_id == user.id
t('body_student', {:one => "An alert has been triggered for you because the following condition has been met:", :other => "An alert has been triggered for you because the following conditions have been met:"}, :count => asset.criteria.length)
else
t('body', {:one => "An alert has been triggered for %{student} because the following condition has been met:", :other => "An alert has been triggered for %{student} because the following conditions have been met:"}, :count => asset.criteria.length, :student => asset_context.user.name)
end
%>
<% asset.criteria.each do |criterion| %>
<%=
case criterion.criterion_type
when 'Interaction'
t('interaction_description', {:one => 'No student/teacher interaction for one day', :other =>'No student/teacher interaction for %{count} or more days'},:count => criterion.threshold)
when 'UngradedCount'
t('ungraded_count_description', {:one => 'One or more assignments have not been graded', :other =>'%{count} or more assignments have not been graded'}, :count => criterion.threshold)
when 'UngradedTimespan'
t('ungraded_timespan_description', {:one => 'One or more submissions have been left ungraded for one or more days', :other =>'One or more submissions have been left ungraded for %{count} or more days'}, :count => criterion.threshold)
when 'UserNote'
t('usernote_description', {:one => 'No faculty journal entries for a day or more', :other =>'No faculty journal entries for %{count} or more days'}, :count => criterion.threshold)
end
%>
<% end %>