forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html.erb
More file actions
78 lines (73 loc) · 2.85 KB
/
Copy pathindex.html.erb
File metadata and controls
78 lines (73 loc) · 2.85 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
70
71
72
73
74
75
76
77
<% content_for :page_title do %><%= t '#crumbs.groups', 'Groups' %><% end %>
<% add_crumb t('#crumbs.groups', 'Groups') %>
<% content_for :right_side do %>
<% end %>
<% css_bundle :course_list %>
<h2><%= t :heading_current_groups, 'Current Groups' %></h2>
<% if @current_groups.empty? %>
<%= t(:no_groups, "No Groups") %>
<% else %>
<table id="my_groups_table" class="ic-Table ic-Table--bordered">
<thead>
<tr>
<th scope="col" class="course-list-group-column"><%= t ('Group') %></th>
<th scope="col" class="course-list-course-title-column course-list-no-left-border"><%= t ('Course') %></th>
<th scope="col" class="course-list-term-column course-list-no-left-border"><%= t ('Term') %></th>
</tr>
</thead>
<tbody>
<% @current_groups.each do |group| %>
<tr>
<td>
<%= link_to group.name, group_path(group) %>
</td>
<td class="course-list-no-left-border">
<span class="group-course-name"><%= group.context.name %></span>
</td>
<td class="course-list-no-left-border">
<% if group.context_type == 'Course' && !group.context.enrollment_term.default_term? %>
<%= group.context.enrollment_term.name %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<h2><%= t :heading_previous_groups, 'Previous Groups' %></h2>
<% if @previous_groups.empty? %>
<%= t(:no_groups, "No Groups") %>
<% else %>
<table id="my_groups_table" class="ic-Table ic-Table--bordered">
<thead>
<tr>
<th scope="col" class="course-list-group-column"><%= t ('Group') %></th>
<th scope="col" class="course-list-course-title-column course-list-no-left-border"><%= t ('Course') %></th>
<th scope="col" class="course-list-term-column course-list-no-left-border"><%= t ('Term') %></th>
</tr>
</thead>
<% @previous_groups.each do |group| %>
<tr>
<td>
<%# Only show a link if the user can read the group - they'll get a permissions error page if they try to %>
<%# hit the link otherwise %>
<% if group.grants_right?(@current_user, session, :read) %>
<%= link_to group.name, group_path(group) %>
<% else %>
<%= group.name %>
<% end %>
</td>
<td>
<%= group.context.name %>
</td>
<td>
<% if group.context_type == 'Course' && !group.context.enrollment_term.default_term? %>
<span class="screenreader-only"><%= group.context.enrollment_term.name %></span>
<% else %>
<%= group.context.enrollment_term.name %>
<% end %>
</td>
</tr>
<% end %>
</table>
<% end %>