<%= @instructor.name %>

<% prev = @instructor.course_sections.reject { |s| s.course.semester == @semester }.map { |s| s.name.split[0..1].join(' ') }.uniq %> <% if prev.count.positive? %> Previously taught: <% end %>

<%= @semester.to_s %>

<% if @courses.any? %> <%= render partial: 'shared/course', collection: @courses, locals: { expanded: true } %> <% else %>

<%= @instructor.name %> is not teaching any courses this semester...

<% end %>