<% # 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 . %> <% course ||= nil %> <% if !course || !course.deleted? %> <% master_template = course && @master_template_index && @master_template_index[course.id] %> <% teacher_names = course && !master_template && (course.teacher_names || course.teachers.distinct.map(&:name)) %> <% student_count = course && !master_template && (course.student_count || course.students.where("enrollments.type <> ?", "StudentViewEnrollment").count) %>
  • " style="<%= hidden unless course %>">
    " class="name"><%= (course && course.name) || nbsp %> " style="<%= (course && course.read_attribute(:workflow_state) && (course.created? || course.claimed?) ? "" : "display: none;") %>">
    <% if course %>
    <%= show_code_and_term_for(course) %> <% if course.respond_to?(:sis_source_id) && course.sis_source_id %> <%= before_label(t(:sis_id_label, "SIS ID")) %> <%= course.sis_source_id %> <% end %>
    <% if master_template %> <%= t('Blueprint Course') %> <% if master_template.last_export_completed_at %>
    <%= t('Last Pushed Update: %{last_export_at}', :last_export_at => datetime_string(master_template.last_export_completed_at)) %><% end %>
    <%= t(:associated_count, {:one => "1 Associated Course", :other => "%{count} Associated Courses"}, :count => master_template.child_course_count) %> <% else %> <% teacher_names_new = teacher_names[0, 2] %> <% teacher_names_new << t(:more_count, { :one => "1 more", :other => "%{count} more" }, :count => teacher_names.length - 2) if teacher_names.length > 2 %> <%= t(:student_count, { :one => "1 Student", :other => "%{count} Students" }, :count => student_count || 0) %> <%= before_label(t(:teachers_label, "Teachers")) %> <%= teacher_names.blank? ? t(:none, 'none') : teacher_names_new.to_sentence %> <% end %>
    <% end %>
    <%= link_to t(:settings_link, "Settings"), course_settings_path(course ? course : "{{ id }}") %> | <%= link_to t(:statistics_link, "Statistics"), course_statistics_path(course ? course : "{{ id }}") %> | <%= link_to t(:homepage_link, "Homepage"), course_path(course ? course : "{{ id }}") %>
  • <% end %>