%
# 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 .
%>
<% dashboard ||= false %>
<% is_current_term ||= false %>
<% # only show updated css in unpublished, current enrollments with FF enabled %>
<% unpublished_course_redesign =
(current_enrollment.course.created? || current_enrollment.course.claimed?) && is_current_term
%>
<% unless dashboard %>
<% end %>
<% if current_enrollment.workflow_state == "invited" && !current_enrollment.inactive? %>
<%= render :partial => 'shared/invitation', :object => current_enrollment %>
<% else %>
<% show_link = [:active, :invited, :accepted, :completed].include?(current_enrollment.state_based_on_date) && (!current_enrollment.course.unpublished? || current_enrollment.admin?) %>
<% if @show_star_column %>
<% if current_enrollment.allows_favoriting? %>
<% favorite_course = @favorite_course_ids.include?(current_enrollment.course_id) %>
<% past_course = enrollments_for_index(:past).include? current_enrollment %>
<% favorite_past_course = past_course && favorite_course %>
<% tooltip_message = t('nonfavorited_tooltip', "Click to add %{course_name} to the courses menu.", course_name: current_enrollment.course.name) if !favorite_course %>
<% tooltip_message = t("%{course_name} cannot be added to the courses menu unless the course is active.", course_name: current_enrollment.course.name) if (!show_link || past_course) %>
<% tooltip_message = t('favorited_tooltip', "Click to remove %{course_name} from the courses menu.", course_name: current_enrollment.course.name) if favorite_course || favorite_past_course %>
<%= "course-list-not-favoritable disabled" if (!show_link || favorite_past_course) %> <%= "course-list-favoritable" if show_link %>"
data-tooltip="bottom"
title="<%= tooltip_message %>"
role="button"
tabindex="0"
data-course-name="<%= current_enrollment.course.name %>"
data-course-id="<%= current_enrollment.course_id %>"
<% if (show_link && (favorite_past_course || !(past_course && !favorite_course))) %>
<%= "data-favorite-url=#{api_v1_add_favorite_course_url(current_enrollment.course_id)}" %>
<% end %>
>
">
<%= tooltip_message %>
<% end %>
|
<% end %>
<% course_color = @current_user.custom_colors["course_#{current_enrollment.course_id}"] %>
<%= "course-list-not-favoritable" unless @show_star_column %>">
<% if course_color.present? %>
" >
<% end %>
<% if show_link %><% end %>
<%= current_enrollment.course.name %>
<% if show_link %>
<% end %>
|
<%= current_enrollment.course.nickname_for(@current_user, nil) %>
|
<% if current_enrollment.course.enrollment_term.default_term? %>
<%= current_enrollment.course.enrollment_term.name %>
<% else %>
<%= current_enrollment.course.enrollment_term.name %>
<% end %>
|
<%= current_enrollment.readable_role_name %>
|
<% if current_enrollment.course.created? || current_enrollment.course.claimed? %>
">
<%= t('unpublished_course', "No") %>
<%= t('unpublished_course_tooltip', "This course has not been published. Students should contact the course instructor for access.") %>
<% else %>
"><%= t('published_course', "Yes") %>
<%= t('published_course_tooltip', "This course has been published.") %>
<% end %>
|
<% end %>
<% unless dashboard %>
<% end %>