canvas-lms/app/messages/alert.summary.erb

29 lines
1.8 KiB
Plaintext

<% 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 %>