_section.html.erb 1.57 KB
Newer Older
Zac Wood's avatar
Zac Wood committed
1
2
3
4
<% unless defined?(editable) %>
    <% editable = true %>
<% end %>

Zac Wood's avatar
Zac Wood committed
5
<li id="section-<%= section.id %>"
6
    class="list-group-item section-item"
Zac Wood's avatar
Zac Wood committed
7
8
    data-crn="<%= section.crn %>"
    data-id="<%= section.id %>"
9
    data-cid="<%= course.id if defined?(course) %>"
10
    data-type="<%= section.section_type %>"
Zac Wood's avatar
Zac Wood committed
11
>
12
13
    <p><b class="subj"><%= "#{section.name}" %></b>:  <%= section.title %></p>

Zac Wood's avatar
Zac Wood committed
14
    <% if editable %>
15
	<% if in_cart? section.crn  %>
Zac Wood's avatar
Zac Wood committed
16
17
18
19
	    <span class="float-right text-center add-remove-btn"><i id="icon" class="fas fa-minus"></i><br/><span class="text">Remove</span></span>	
	<% else %>
	    <span class="float-right text-center add-remove-btn"><i id="icon" class="fas fa-plus"></i><br/><span class="text">Add</span></span>
	<% end %>
20
21
    <% end %>
    
Zac Wood's avatar
Zac Wood committed
22
23
24
25
    <i class="fas fa-chalkboard-teacher"></i>
    <% if section.instructor.name == "TBA" %>
	TBA
    <% else %>
Zac Wood's avatar
Zac Wood committed
26
	<%= link_to section.instructor.name, section.instructor %>
Zac Wood's avatar
Zac Wood committed
27
	<% unless section.instructor.rating.nil? %>
Zac Wood's avatar
Zac Wood committed
28
	    <%= render partial: 'shared/stars', locals: { percent: (section.instructor.rating[0] / 5 * 100).to_i }%>
Zac Wood's avatar
Zac Wood committed
29
	<% end %>
Zac Wood's avatar
Zac Wood committed
30
31
    <% end %>
    <br/>
Zac Wood's avatar
Zac Wood committed
32
    
33
34
    <i class="fas fa-map-marker-alt"></i> <%= section.location %> <br/>
    <i class="fas fa-clock"></i> <%= "#{section.days}, #{section.start_time}-#{section.end_time}" %> <br/>
Zac Wood's avatar
Zac Wood committed
35
36
37
38
39
40
41
42
43

    <% unless section.rating_questions.empty? %>
	<br/>
	<b>Rating Info</b> (<%= link_to("See all ratings", course_section_url(section))%>)
	<ul>
	    <li>Instructor rating: <%= section.teaching_rating %></li>
	    <li>Course rating: <%= section.course_rating %></li>
	</ul>
    <% end %>
Zac Wood's avatar
Zac Wood committed
44
</li>