_section.html.erb 1.5 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
6
7
8
<% unless defined?(show_instr) %>
    <% show_instr = true %>
<% end %>

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

Zac Wood's avatar
Zac Wood committed
18
    <% if editable %>
19
	    <span class="float-right text-center add-remove-btn"><i id="icon" class="fas fa-ellipsis-h"></i><br/><span class="text">Add</span></span>
20
    <% end %>
Zac Wood's avatar
Zac Wood committed
21
22


Zac Wood's avatar
Zac Wood committed
23
24
25
26
    <i class="fas fa-chalkboard-teacher"></i>
    <% if section.instructor.name == "TBA" %>
	TBA
    <% else %>
Zac Wood's avatar
Zac Wood committed
27
	<%= link_to section.instructor.name, section.instructor %>
Zac Wood's avatar
Zac Wood committed
28
	<% unless section.instructor.rating.nil? || !show_instr %>
Zac Wood's avatar
Zac Wood committed
29
	    <%= render partial: 'shared/stars', locals: { percent: (section.instructor.rating[0] / 5 * 100).to_i }%>
Zac Wood's avatar
Zac Wood committed
30
	<% end %>
Zac Wood's avatar
Zac Wood committed
31
	
Zac Wood's avatar
Zac Wood committed
32
33
    <% end %>
    <br/>
Zac Wood's avatar
Zac Wood committed
34

Zac Wood's avatar
Zac Wood committed
35
    
36
37
    <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
38
39
40
41
42
43
44
45
46

    <% 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
47
</li>