show.html.erb 686 Bytes
Newer Older
Zac Wood's avatar
Zac Wood committed
1 2 3 4
<div class="row">
    <div class="col-4">
	<h1><%= @instructor.name %></h1>
	<% prev = @instructor.course_sections.reject { |s| s.course.semester == @semester }.map { |s| s.name.split[0..1].join(' ') }.uniq %>
5

Zac Wood's avatar
Zac Wood committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
	<% if prev.count.positive? %>
	    <strong>Previously taught: </strong>
	    <ul>
		<% prev.each do |s| %>
		    <li><%= s %></li>
		<% end %>
	    </ul>
	<% end %>
    </div>

    <div class ="col-8">
	<h3><%= @semester.to_s %></h3>
	<% if @courses.any? %>
	    <%= render partial: 'shared/course', collection: @courses, locals: { expanded: true } %>
	<% else %>
	    <p><%= @instructor.name %> is not teaching any courses this semester...</p>
	<% end %>
    </div>
</div>