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
2a74f5c8
Commit
2a74f5c8
authored
Oct 30, 2019
by
Zac Wood
Browse files
Add online courses to schedule page
parent
dd3c5822
Pipeline
#5100
passed with stage
in 2 minutes and 24 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
schedules/app/controllers/course_sections_controller.rb
View file @
2a74f5c8
...
...
@@ -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