Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
schedules
Commits
db5fd951
Commit
db5fd951
authored
Oct 31, 2019
by
Zac Wood
Browse files
Merge branch 'fix-online-in-schedule' into 'master'
Add online courses to schedule page See merge request
!54
parents
dd3c5822
a43bcd3e
Pipeline
#5102
passed with stages
in 26 minutes
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
schedules/app/controllers/course_sections_controller.rb
View file @
db5fd951
...
...
@@ -5,17 +5,20 @@ class CourseSectionsController < ApplicationController
@sections
=
crns
.
map
{
|
crn
|
CourseSection
.
latest_by_crn
(
crn
)
}
@days
=
{
"M"
=>
[],
"T"
=>
[],
"W"
=>
[],
"R"
=>
[],
"F"
=>
[]
"R"
=>
[],
"F"
=>
[]
,
"Online"
=>
[]
}
@sections
.
each
do
|
s
|
s
.
days
.
split
(
''
).
each
do
|
day
|
days
=
s
.
days
.
gsub
(
/[^a-zA-Z]/
,
""
)
# get rid of weird character
@days
[
"Online"
]
<<
s
if
days
.
empty?
days
.
split
(
''
).
each
do
|
day
|
@days
[
day
]
<<
s
unless
s
.
start_time
==
"TBA"
end
end
@days_map
=
{
"M"
=>
"Monday"
,
"T"
=>
"Tuesday"
,
"W"
=>
"Wednesday"
,
"R"
=>
"Thursday"
,
"F"
=>
"Friday"
"R"
=>
"Thursday"
,
"F"
=>
"Friday"
,
"Online"
=>
"Online"
}
@days
.
each
do
|
day
,
sections
|
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment