forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path_enrollment.html.erb
More file actions
69 lines (64 loc) · 2.94 KB
/
Copy path_enrollment.html.erb
File metadata and controls
69 lines (64 loc) · 2.94 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<%
# 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 <http://www.gnu.org/licenses/>.
%>
<li class="<%= 'unpublished' if enrollment.course.created? || enrollment.course.claimed? %> <%= enrollment.state_based_on_date %> clearfix">
<a href="<%= course_user_path(enrollment.course_id, enrollment.user_id) %>" style="float: left; max-width: 800px;">
<span class="name" title="<%= enrollment.long_name(@current_user) %>">
<%= enrollment.long_name(@current_user) %>
<% if enrollment.course.created? || enrollment.course.claimed? %>
<i class="icon-unpublish" title="<%= t('course_not_published', "This course hasn't been published yet") %>"></i>
<% end %>
</span>
<% unless enrollment.course.enrollment_term.default_term? %>
<span class="subtitle ellipsis"><%= enrollment.course.enrollment_term.name %></span>
<% end %>
<span class="subtitle ellipsis">
<%= Enrollment.workflow_readable_type(enrollment.readable_state_based_on_date) %>,
<%=
case enrollment.class.to_s
when 'TeacherEnrollment'
t('roles_teacher', "Enrolled as a Teacher.")
when 'StudentEnrollment'
t('roles_student', "Enrolled as a Student.")
when 'TaEnrollment'
t('roles_ta', "Enrolled as a TA.")
when 'ObserverEnrollment'
t('roles_observer', "Enrolled as an Observer.")
when 'DesignerEnrollment'
t('roles_designer', "Enrolled as a Designer.")
else
t('roles_student', "Enrolled as a Student.")
end
%>
<% if enrollment.associated_user %>
<%= t('linked_to_user', '(Linked to %{user_name})', :user_name => enrollment.associated_user.name) %>
<% end %>
</span>
</a>
<span style="float: right; margin-right: 5px; margin-top: 3px;">
<a href="#" rel="<%= course_unenroll_url(enrollment.course_id, enrollment.id) %>" class="unenroll_link" role="button">
<i class="icon-end standalone-icon"></i>
<span class="screenreader-only"><%= t(:unenrollr, "Unenroll") %></span>
</a>
</span>
<% if enrollment.admin? && can_do(enrollment.user, @current_user, :read_reports) %>
<div style='clear:left'>
<%= link_to(t('links.teacher_activity', 'See Student Interactions Report'), user_course_teacher_activity_url(enrollment.user_id, enrollment.course_id)) %>
</div>
<% end %>
<span class="clear"></span>
</li>