_course.html.erb 1.79 KB
Newer Older
1
2
<% expanded = false unless defined? expanded %>

3
<div class="card" id="course-<%= course.id %>" onclick="toggleSections(this)">
Zac Wood's avatar
Zac Wood committed
4
    <div class="card-header">
Zac Wood's avatar
Zac Wood committed
5
6
7
8
9
10
11
12
13
14
15
16
	<div class="row">
	    <div class="col">
		<h4 class="title"><%= "#{course.subject} #{course.course_number}" %></h4>
	    </div>
	    
	    <div class="col">
		<h4 id="add-course-btn" class="text-right" onclick="addCourse(event, '<%= course.id %>');">
		    <i class="fas fa-plus" style="color: green"></i>
		</h4>
	    </div>    
	</div>
	<h5><em><%= course.title %></em></h5>
Zac Wood's avatar
Zac Wood committed
17
    </div>
Zac Wood's avatar
Zac Wood committed
18
    <div class="card-body">
Zac Wood's avatar
Zac Wood committed
19
20
21
22
23
24
25
26
27
28
29
30
31
32
	<div class="attr-list justify-content-start">
	    <div class="attr">
		<div class="icon">
		    <i class="fa fa-book"></i>
		</div>
		3 credits
	    </div>
	    &nbsp;&nbsp;&nbsp;
	    <div class="attr">
		<div class="icon">
		    <i class="fa fa-bars"></i>
		</div>
		3 sections
	    </div>
Zac Wood's avatar
Zac Wood committed
33
34
	</div>
	<p class="description"><%= course.description %></p>
Zac Wood's avatar
Zac Wood committed
35

Zac Wood's avatar
Zac Wood committed
36
37
38
39
40
41
42
43
44
45
46
47
48
	<% unless course.prereqs.nil? || course.prereqs.empty? %>
    	    <% first, rest = course.prereqs.split(':') %>
    	    <% prereqs, note = rest.split('.') %>
    	    <p><strong><%= first %>:</strong> <%= prereqs %> <sub><%= note %></sub></p>
	<% end %>
	
	<div class="d-block" style="text-align: center">
  	    <p style="margin-bottom:-4px; font-size: 10px;">Expand</p>
  	    <i class="fas fa-chevron-down"></i>
	</div>
	
	<!-- List of Course Sections -->
	<div class="list-group list-group-flush sections" style="display: <%= expanded ? "flex" : "none" %>">
49
	    <% if defined?(@instructor) %>
Zac Wood's avatar
Zac Wood committed
50
		<%= render partial: 'shared/section', collection: course.course_sections.where(instructor: @instructor), locals: { course: course } %>
51
	    <% else %>
Zac Wood's avatar
Zac Wood committed
52
		<%= render partial: 'shared/section', collection: course.course_sections, locals: { course: course } %>
53
	    <% end %>
Zac Wood's avatar
Zac Wood committed
54
	</div>
55
    </div>
Zac Wood's avatar
Zac Wood committed
56
</div>