Commit 759d2585 authored by Zac Wood's avatar Zac Wood

Clean up

parent d3970aa1
...@@ -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
// } // }
# 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
...@@ -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|
......
...@@ -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}
......
...@@ -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 = { crns: '' }; this.state = { crnString: '' };
} }
add = e => { add = e => {
e.preventDefault(); e.preventDefault();
const crns = this.state.crns.split(','); const crns = this.state.crnString.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({ crns: e.target.value })} onChange={e => this.setState({ crnString: e.target.value })}
className="form-control" className="form-control"
placeholder="12345,54321,..." placeholder="12345,54321,..."
aria-describedby="basic-addon2" aria-describedby="basic-addon2"
......
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