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
759d2585
Commit
759d2585
authored
May 03, 2019
by
Zac Wood
Browse files
Clean up
parent
d3970aa1
Changes
5
Hide whitespace changes
Inline
Side-by-side
schedules/app/assets/stylesheets/application.scss
View file @
759d2585
...
@@ -119,6 +119,15 @@ body {
...
@@ -119,6 +119,15 @@ body {
top
:
0
;
top
:
0
;
}
}
.full-width
{
width
:
90vw
;
position
:
relative
;
left
:
50%
;
right
:
50%
;
margin-left
:
-45vw
;
margin-right
:
-45vw
;
}
// .jumbotron {
// .jumbotron {
// color: #FFFFFF
// color: #FFFFFF
// }
// }
schedules/app/controllers/concerns/by_semester.rb
View file @
759d2585
# BySemester contains logic for setting the current request's
# BySemester contains logic for setting the current request's Semester.
# Semester. This is not needed by every page as it used to be, so it
# now lives in this concern instead of ApplicationController.
module
BySemester
module
BySemester
extend
ActiveSupport
::
Concern
extend
ActiveSupport
::
Concern
...
@@ -9,19 +7,19 @@ module BySemester
...
@@ -9,19 +7,19 @@ module BySemester
end
end
# This page needs to know what semester it should load data from.
# This page needs to know what semester it should load data from.
# set_semester checks both the semester_id query parameter and the
user's cookies
# set_semester checks both the semester_id query parameter and the
current session
# to look for a semester id and loads whatever it finds into @semester.
# to look for a semester id and loads whatever it finds into @semester.
#
#
# By default, load the most recent semester.
# By default, load the most recent semester.
def
set_semester
def
set_semester
if
params
.
key?
(
:semester_id
)
if
params
.
key?
(
:semester_id
)
@semester
=
Semester
.
find_by_id
params
[
:semester_id
]
@semester
=
Semester
.
find_by_id
(
params
[
:semester_id
]
)
cookies
[
:semester_id
]
=
@semester
.
id
session
[
:semester_id
]
=
@semester
.
id
elsif
cookies
[
:semester_id
].
nil?
elsif
session
[
:semester_id
].
nil?
@semester
=
Semester
.
first
@semester
=
Semester
.
first
cookies
[
:semester_id
]
=
@semester
.
id
session
[
:semester_id
]
=
@semester
.
id
else
else
@semester
=
Semester
.
find_by_id
cookies
[
:semester_id
]
@semester
=
Semester
.
find_by_id
(
session
[
:semester_id
]
)
end
end
end
end
end
end
schedules/app/controllers/search_controller.rb
View file @
759d2585
...
@@ -42,7 +42,6 @@ class SearchController < ApplicationController
...
@@ -42,7 +42,6 @@ class SearchController < ApplicationController
c
.
serializable_hash
.
merge
(
url:
course_url
(
c
))
c
.
serializable_hash
.
merge
(
url:
course_url
(
c
))
end
end
gon
.
courses
=
@courses
gon
.
courses
=
@courses
gon
.
courses
.
map!
end
end
/[0-9]{5}/
.
match
(
params
[
:query
])
do
|
m
|
/[0-9]{5}/
.
match
(
params
[
:query
])
do
|
m
|
...
...
schedules/app/javascript/src/Calendar.jsx
View file @
759d2585
...
@@ -6,7 +6,7 @@ import '!style-loader!css-loader!react-big-calendar/lib/css/react-big-calendar.c
...
@@ -6,7 +6,7 @@ import '!style-loader!css-loader!react-big-calendar/lib/css/react-big-calendar.c
const
localizer
=
BigCalendar
.
momentLocalizer
(
moment
);
const
localizer
=
BigCalendar
.
momentLocalizer
(
moment
);
const
Calendar
=
props
=>
(
const
Calendar
=
props
=>
(
<
div
style
=
{
{
backgroundColor
:
'
white
'
,
padding
:
'
24px
'
}
}
>
<
div
className
=
"full-width"
style
=
{
{
backgroundColor
:
'
white
'
,
padding
:
'
24px
'
}
}
>
<
BigCalendar
<
BigCalendar
localizer
=
{
localizer
}
localizer
=
{
localizer
}
events
=
{
props
.
events
}
events
=
{
props
.
events
}
...
...
schedules/app/javascript/src/QuickAdd.jsx
View file @
759d2585
...
@@ -4,12 +4,12 @@ import Cart from 'src/Cart';
...
@@ -4,12 +4,12 @@ import Cart from 'src/Cart';
export
default
class
QuickAdd
extends
React
.
Component
{
export
default
class
QuickAdd
extends
React
.
Component
{
constructor
(
props
)
{
constructor
(
props
)
{
super
(
props
);
super
(
props
);
this
.
state
=
{
crn
s
:
''
};
this
.
state
=
{
crn
String
:
''
};
}
}
add
=
e
=>
{
add
=
e
=>
{
e
.
preventDefault
();
e
.
preventDefault
();
const
crns
=
this
.
state
.
crn
s
.
split
(
'
,
'
);
const
crns
=
this
.
state
.
crn
String
.
split
(
'
,
'
);
crns
.
forEach
(
c
=>
c
.
length
===
5
&&
Cart
.
addCrn
(
c
));
crns
.
forEach
(
c
=>
c
.
length
===
5
&&
Cart
.
addCrn
(
c
));
this
.
props
.
loadCalendar
();
this
.
props
.
loadCalendar
();
};
};
...
@@ -26,7 +26,7 @@ export default class QuickAdd extends React.Component {
...
@@ -26,7 +26,7 @@ export default class QuickAdd extends React.Component {
name
=
"crns"
name
=
"crns"
type
=
"text"
type
=
"text"
value
=
{
this
.
state
.
crns
}
value
=
{
this
.
state
.
crns
}
onChange
=
{
e
=>
this
.
setState
({
crn
s
:
e
.
target
.
value
})
}
onChange
=
{
e
=>
this
.
setState
({
crn
String
:
e
.
target
.
value
})
}
className
=
"form-control"
className
=
"form-control"
placeholder
=
"12345,54321,..."
placeholder
=
"12345,54321,..."
aria
-
describedby
=
"basic-addon2"
aria
-
describedby
=
"basic-addon2"
...
...
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