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

<%= t('headings.my_courses', %{All Courses}) %>

<% if @domain_root_account.enable_course_catalog? %> <%= link_to t('browse_more_courses', 'Browse More Courses'), "/search/all_courses/", class:"Button" %> <% end %> <% if show_user_create_course_button(@current_user) %> <%= render :partial => 'shared/new_course_form' %> <% end %>
<% if enrollments_for_index(:current).empty? %> <%= t("You are not enrolled in any courses.") %> <% else %> <% enrollments_for_index(:current).each do |enrollment| %> <%= render :partial => "shared/current_enrollment", :object => enrollment, :locals => { :is_current_term => true } %> <% end %>
<%= t ('Favorites') %> <%= t ('Course') %> <%= t ('Nickname') %> <%= t ('Term') %> <%= t ('Enrolled as') %> <%= t ('Published') %>
<% end %> <% @show_star_column = true %> <% unless enrollments_for_index(:past).empty? %>

<%= t('headings.past_enrollments', %{Past Enrollments}) %>

<% enrollments_for_index(:past).each do |enrollment| %> <%= render :partial => "shared/current_enrollment", :object => enrollment %> <% end %>
<%= t ('Favorites') %> <%= t ('Course') %> <%= t ('Nickname') %> <%= t ('Term') %> <%= t ('Enrolled as') %> <%= t ('Published') %>
<% end %> <% unless enrollments_for_index(:future).empty? %>

<%= t('headings.future_enrollments', 'Future Enrollments') %>

<% enrollments_for_index(:future).each do |enrollment| %> <%= render :partial => 'shared/current_enrollment', :object => enrollment %> <% end %>
<%= t ('Favorites') %> <%= t ('Course') %> <%= t ('Nickname') %> <%= t ('Term') %> <%= t ('Enrolled as') %> <%= t ('Published') %>
<% end %> <% @show_star_column = false %> <% unless @visible_groups.empty? %>

<%= t('headings.my_groups', %{My Groups}) %>

<% @visible_groups.each do |group| %> <% group_name = group.name %> <% end %>
<%= t ('Group') %> <%= t ('Course') %> <%= t ('Term') %>
> <%= group_name %> <%= group.context.name %> <% if group.context_type == 'Course' && !group.context.enrollment_term.default_term? %> <%= group.context.enrollment_term.name %> <% end %>
<% end %>