forked from instructure/canvas-lms
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html.erb
96 lines (90 loc) · 3.52 KB
/
index.html.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
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<%
# 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/>.
%>
<% 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 %>