Commit a43bcd3e authored by Zac Wood's avatar Zac Wood

Add online courses to schedule page

parent dd3c5822
...@@ -5,17 +5,20 @@ class CourseSectionsController < ApplicationController ...@@ -5,17 +5,20 @@ class CourseSectionsController < ApplicationController
@sections = crns.map { |crn| CourseSection.latest_by_crn(crn) } @sections = crns.map { |crn| CourseSection.latest_by_crn(crn) }
@days = { @days = {
"M" => [], "T" => [], "W" => [], "M" => [], "T" => [], "W" => [],
"R" => [], "F" => [] "R" => [], "F" => [], "Online" => []
} }
@sections.each do |s| @sections.each do |s|
s.days.split('').each do |day| days = s.days.gsub(/[^a-zA-Z]/, "") # get rid of weird &nbsp; character
@days["Online"] << s if days.empty?
days.split('').each do |day|
@days[day] << s unless s.start_time == "TBA" @days[day] << s unless s.start_time == "TBA"
end end
end end
@days_map = { @days_map = {
"M" => "Monday", "T" => "Tuesday", "W" => "Wednesday", "M" => "Monday", "T" => "Tuesday", "W" => "Wednesday",
"R" => "Thursday", "F" => "Friday" "R" => "Thursday", "F" => "Friday", "Online" => "Online"
} }
@days.each do |day, sections| @days.each do |day, sections|
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment