%
# 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 .
%>
<% provide :page_title, t('titles.courses', 'Courses') %>
<% provide_blank :right_side %>
<% load_enrollments_for_index %>
<% @visible_groups ||= @current_user.visible_groups %>
<% @favorite_course_ids = @current_user.courses_with_primary_enrollment(:favorite_courses).map(&:id) %>
<% @show_star_column = true %>
<% if enrollments_for_index(:current).empty? %>
<%= t("You are not enrolled in any courses.") %>
<% else %>
<%= t ('Favorites') %> |
<%= t ('Course') %> |
<%= t ('Nickname') %> |
<%= t ('Term') %> |
<%= t ('Enrolled as') %> |
<%= t ('Published') %> |
<% enrollments_for_index(:current).each do |enrollment| %>
<%= render :partial => "shared/current_enrollment", :object => enrollment, :locals => { :is_current_term => true } %>
<% end %>
<% end %>
<% @show_star_column = true %>
<% unless enrollments_for_index(:past).empty? %>
<%= t('headings.past_enrollments', %{Past Enrollments}) %>
<%= t ('Favorites') %> |
<%= t ('Course') %> |
<%= t ('Nickname') %> |
<%= t ('Term') %> |
<%= t ('Enrolled as') %> |
<%= t ('Published') %> |
<% enrollments_for_index(:past).each do |enrollment| %>
<%= render :partial => "shared/current_enrollment", :object => enrollment %>
<% end %>
<% end %>
<% unless enrollments_for_index(:future).empty? %>
<%= t('headings.future_enrollments', 'Future Enrollments') %>
<%= t ('Favorites') %> |
<%= t ('Course') %> |
<%= t ('Nickname') %> |
<%= t ('Term') %> |
<%= t ('Enrolled as') %> |
<%= t ('Published') %> |
<% enrollments_for_index(:future).each do |enrollment| %>
<%= render :partial => 'shared/current_enrollment', :object => enrollment %>
<% end %>
<% end %>
<% @show_star_column = false %>
<% unless @visible_groups.empty? %>
<%= t('headings.my_groups', %{My Groups}) %>
<%= t ('Group') %> |
<%= t ('Course') %> |
<%= t ('Term') %> |
<% @visible_groups.each do |group| %>
<% group_name = group.name %>
>
<%= group_name %>
|
<%= group.context.name %>
|
<% if group.context_type == 'Course' && !group.context.enrollment_term.default_term? %>
<%= group.context.enrollment_term.name %>
<% end %>
|
<% end %>
<% end %>