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

Clean up

parent d3970aa1
......@@ -119,6 +119,15 @@ body {
top: 0;
}
.full-width {
width: 90vw;
position: relative;
left: 50%;
right: 50%;
margin-left: -45vw;
margin-right: -45vw;
}
// .jumbotron {
// color: #FFFFFF
// }
# BySemester contains logic for setting the current request's
# Semester. This is not needed by every page as it used to be, so it
# now lives in this concern instead of ApplicationController.
# BySemester contains logic for setting the current request's Semester.
module BySemester
extend ActiveSupport::Concern
......@@ -9,19 +7,19 @@ module BySemester
end
# 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.
#
# By default, load the most recent semester.
def set_semester
if params.key?(:semester_id)
@semester = Semester.find_by_id params[:semester_id]
cookies[:semester_id] = @semester.id
elsif cookies[:semester_id].nil?
@semester = Semester.find_by_id(params[:semester_id])
session[:semester_id] = @semester.id
elsif session[:semester_id].nil?
@semester = Semester.first
cookies[:semester_id] = @semester.id
session[:semester_id] = @semester.id
else
@semester = Semester.find_by_id cookies[:semester_id]
@semester = Semester.find_by_id(session[:semester_id])
end
end
end
......@@ -42,7 +42,6 @@ class SearchController < ApplicationController
c.serializable_hash.merge(url: course_url(c))
end
gon.courses = @courses
gon.courses.map!
end
/[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
const localizer = BigCalendar.momentLocalizer(moment);
const Calendar = props => (
<div style={{ backgroundColor: 'white', padding: '24px' }}>
<div className="full-width" style={{ backgroundColor: 'white', padding: '24px' }}>
<BigCalendar
localizer={localizer}
events={props.events}
......
......@@ -4,12 +4,12 @@ import Cart from 'src/Cart';
export default class QuickAdd extends React.Component {
constructor(props) {
super(props);
this.state = { crns: '' };
this.state = { crnString: '' };
}
add = e => {
e.preventDefault();
const crns = this.state.crns.split(',');
const crns = this.state.crnString.split(',');
crns.forEach(c => c.length === 5 && Cart.addCrn(c));
this.props.loadCalendar();
};
......@@ -26,7 +26,7 @@ export default class QuickAdd extends React.Component {
name="crns"
type="text"
value={this.state.crns}
onChange={e => this.setState({ crns: e.target.value })}
onChange={e => this.setState({ crnString: e.target.value })}
className="form-control"
placeholder="12345,54321,..."
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