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
d213fe83
Commit
d213fe83
authored
Jul 14, 2019
by
Zac Wood
Browse files
Merge branch 'dev-v3' into 'master'
Version 3 See merge request
!51
parents
b6309e4e
80cf9394
Pipeline
#4473
passed with stage
in 2 minutes and 47 seconds
Changes
96
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.prettierrc
0 → 100644
View file @
d213fe83
{
"printWidth": 120,
"tabWidth": 4,
"singleQuote": true,
"useTabs": false,
"jsxBracketSameLine": true,
"trailingComma": "es5"
}
schedules/.babelrc
View file @
d213fe83
{
{
"presets": [
"presets": [
["env", {
[
"modules": false,
"env",
"targets": {
{
"browsers": "> 1%",
"modules": false,
"uglify": true
"targets": {
},
"browsers": "> 1%",
"useBuiltIns": true
"uglify": true
}]
},
"useBuiltIns": true
}
],
"react"
],
],
"plugins": [
"plugins": [
"syntax-dynamic-import",
"syntax-dynamic-import",
"transform-object-rest-spread",
"transform-object-rest-spread",
["transform-class-properties", { "spec": true }]
[
"transform-class-properties",
{
"spec": true
}
]
]
]
}
}
schedules/Dockerfile
View file @
d213fe83
...
@@ -14,3 +14,4 @@ RUN export SECRET_KEY_BASE=$(rails secret)
...
@@ -14,3 +14,4 @@ RUN export SECRET_KEY_BASE=$(rails secret)
RUN
rails assets:precompile
RUN
rails assets:precompile
RUN
rails db:migrate
RUN
rails db:migrate
RUN
rails db:seed
RUN
rails db:seed
RUN
rails runner db/load_course_ratings.rb
schedules/Gemfile
View file @
d213fe83
...
@@ -21,6 +21,9 @@ gem 'uglifier'
...
@@ -21,6 +21,9 @@ gem 'uglifier'
gem
'webpacker'
,
'~> 3.5'
gem
'webpacker'
,
'~> 3.5'
# Access Ruby data from JavaScript
gem
'gon'
# Use Redis adapter to run Action Cable in production
# Use Redis adapter to run Action Cable in production
# gem 'redis', '~> 4.0'
# gem 'redis', '~> 4.0'
# Use ActiveModel has_secure_password
# Use ActiveModel has_secure_password
...
@@ -74,7 +77,3 @@ gem 'apipie-rails'
...
@@ -74,7 +77,3 @@ gem 'apipie-rails'
# Markdown for API docs
# Markdown for API docs
gem
'maruku'
gem
'maruku'
# gem 'jquery-rails'
# gem 'font-awesome-sass', '~> 5.3.1'
schedules/Gemfile.lock
View file @
d213fe83
...
@@ -64,6 +64,10 @@ GEM
...
@@ -64,6 +64,10 @@ GEM
ffi (1.9.25)
ffi (1.9.25)
globalid (0.4.1)
globalid (0.4.1)
activesupport (>= 4.2.0)
activesupport (>= 4.2.0)
gon (6.2.1)
actionpack (>= 3.0)
multi_json
request_store (>= 1.0)
httparty (0.16.3)
httparty (0.16.3)
mime-types (~> 3.0)
mime-types (~> 3.0)
multi_xml (>= 0.5.2)
multi_xml (>= 0.5.2)
...
@@ -144,6 +148,8 @@ GEM
...
@@ -144,6 +148,8 @@ GEM
rb-fsevent (0.10.3)
rb-fsevent (0.10.3)
rb-inotify (0.9.10)
rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2)
ffi (>= 0.5.0, < 2)
request_store (1.4.1)
rack (>= 1.4)
rubocop (0.58.2)
rubocop (0.58.2)
jaro_winkler (~> 1.5.1)
jaro_winkler (~> 1.5.1)
parallel (~> 1.10)
parallel (~> 1.10)
...
@@ -216,6 +222,7 @@ DEPENDENCIES
...
@@ -216,6 +222,7 @@ DEPENDENCIES
apipie-rails
apipie-rails
byebug
byebug
capybara (~> 2.13)
capybara (~> 2.13)
gon
httparty
httparty
icalendar
icalendar
jbuilder (~> 2.5)
jbuilder (~> 2.5)
...
...
schedules/app/assets/images/favicon-32x32.png
0 → 100644
View file @
d213fe83
685 Bytes
schedules/app/assets/images/favicon.ico
0 → 100644
View file @
d213fe83
14.7 KB
schedules/app/assets/javascripts/about.js
0 → 100644
View file @
d213fe83
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
schedules/app/assets/javascripts/course_sections.js
0 → 100644
View file @
d213fe83
// Place all the behaviors and hooks related to the matching controller here.
// All this logic will automatically be available in application.js.
schedules/app/assets/stylesheets/about.scss
0 → 100644
View file @
d213fe83
// Place all the styles related to the about controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
schedules/app/assets/stylesheets/application.scss
View file @
d213fe83
...
@@ -20,6 +20,11 @@ body {
...
@@ -20,6 +20,11 @@ body {
background-color
:
#E4E4E4
;
background-color
:
#E4E4E4
;
}
}
#page
{
padding-top
:
16px
;
padding-bottom
:
16px
;
}
.card
{
.card
{
margin-bottom
:
12px
;
margin-bottom
:
12px
;
...
@@ -90,3 +95,39 @@ body {
...
@@ -90,3 +95,39 @@ body {
.quick-add-header
{
.quick-add-header
{
margin-top
:
32px
;
margin-top
:
32px
;
}
}
%flex-display
{
display
:
inline-flex
;
}
.star-rating
{
@extend
%flex-display
;
align-items
:
center
;
font-size
:
1em
;
justify-content
:
flex-start
;
}
.back-stars
{
@extend
%flex-display
;
position
:
relative
;
text-shadow
:
4px
4px
10px
#843a3a
;
}
.front-stars
{
@extend
%flex-display
;
color
:
#FFBC0B
;
overflow
:
hidden
;
position
:
absolute
;
text-shadow
:
2px
2px
5px
#d29b09
;
top
:
0
;
}
.full-width
{
width
:
90vw
;
position
:
relative
;
left
:
50%
;
right
:
50%
;
margin-left
:
-45vw
;
margin-right
:
-45vw
;
}
// .jumbotron {
// color: #FFFFFF
// }
schedules/app/assets/stylesheets/course_sections.scss
0 → 100644
View file @
d213fe83
// Place all the styles related to the course_sections controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
schedules/app/assets/stylesheets/navbar.scss
View file @
d213fe83
...
@@ -18,6 +18,7 @@
...
@@ -18,6 +18,7 @@
#semester-select
{
#semester-select
{
min-width
:
100px
;
min-width
:
100px
;
margin-right
:
8px
;
}
}
#cart-button
{
#cart-button
{
...
...
schedules/app/assets/stylesheets/schedules.scss
View file @
d213fe83
...
@@ -18,3 +18,10 @@
...
@@ -18,3 +18,10 @@
#share-header
{
#share-header
{
margin-top
:
16px
;
margin-top
:
16px
;
}
}
.btn-variant
{
background-color
:
transparent
;
text-align
:
left
;
border
:
none
;
padding
:
0px
;
}
schedules/app/controllers/about_controller.rb
0 → 100644
View file @
d213fe83
class
AboutController
<
ApplicationController
def
index
;
end
end
schedules/app/controllers/api/course_sections_controller.rb
View file @
d213fe83
...
@@ -28,7 +28,6 @@ class API::CourseSectionsController < ApplicationController
...
@@ -28,7 +28,6 @@ class API::CourseSectionsController < ApplicationController
@sections
=
@sections
.
where
(
'UPPER(instructors.name) LIKE UPPER(?)'
,
"%
#{
params
[
:instructor
]
}
%"
)
@sections
=
@sections
.
where
(
'UPPER(instructors.name) LIKE UPPER(?)'
,
"%
#{
params
[
:instructor
]
}
%"
)
end
end
# @sections = CourseSection.fetch(params).all
res
=
@sections
.
map
do
|
s
|
res
=
@sections
.
map
do
|
s
|
{
{
id:
s
.
id
,
id:
s
.
id
,
...
@@ -38,6 +37,9 @@ class API::CourseSectionsController < ApplicationController
...
@@ -38,6 +37,9 @@ class API::CourseSectionsController < ApplicationController
crn:
s
.
crn
,
crn:
s
.
crn
,
title:
s
.
title
,
title:
s
.
title
,
instructor_name:
s
.
instructor_name
,
instructor_name:
s
.
instructor_name
,
instructor_url:
instructor_url
(
s
.
instructor
),
teaching_rating:
s
.
instructor
.
rating
,
course_rating:
s
.
course_rating
,
section_type:
s
.
section_type
,
section_type:
s
.
section_type
,
start_date:
s
.
start_date
,
start_date:
s
.
start_date
,
end_date:
s
.
end_date
,
end_date:
s
.
end_date
,
...
...
schedules/app/controllers/api/schedules_controller.rb
View file @
d213fe83
...
@@ -8,7 +8,7 @@ class API::SchedulesController < ApplicationController
...
@@ -8,7 +8,7 @@ class API::SchedulesController < ApplicationController
param
:crns
,
String
,
desc:
'Comma separated list of crns to include as events in the calendar'
,
required:
true
param
:crns
,
String
,
desc:
'Comma separated list of crns to include as events in the calendar'
,
required:
true
def
index
def
index
crns
=
params
[
"crns"
].
split
','
crns
=
params
[
"crns"
].
split
','
@schedule
=
Schedule
.
new
crns
@schedule
=
Schedule
.
new
(
crns
,
@semester
.
season
)
render
plain:
@schedule
.
to_ical
# render a plaintext iCal file
render
plain:
@schedule
.
to_ical
# render a plaintext iCal file
end
end
end
end
schedules/app/controllers/application_controller.rb
View file @
d213fe83
# Configures the application.
# Configures the application.
class
ApplicationController
<
ActionController
::
Base
class
ApplicationController
<
ActionController
::
Base
protect_from_forgery
with: :null_session
include
BySemester
# On each request, set the semester and cart.
before_action
:set_semester
,
:set_cart
# Every 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
# 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
.
first
cookies
[
:semester_id
]
=
@semester
.
id
else
@semester
=
Semester
.
find_by_id
cookies
[
:semester_id
]
end
end
# The user's cart is stored as a JSON-encoded list of CRNs.
# set_cart sets the @cart variable, which is a list of the sections represented by the CRNs.
def
set_cart
# set the cart cookie to be empty if it doesn't already exist
cookies
.
permanent
[
:cart
]
=
"[]"
if
cookies
.
permanent
[
:cart
].
nil?
# decode the JSON list into an array
@cart
=
JSON
.
parse
(
cookies
.
permanent
[
:cart
])
# get rid of any invalid CRNs
@cart
=
@cart
.
reject
{
|
crn
|
CourseSection
.
find_by_crn
(
crn
).
nil?
}
# set the cookie to the JSON-encoded list of valid sections
cookies
.
permanent
[
:cart
]
=
@cart
.
to_json
end
end
end
schedules/app/controllers/concerns/by_semester.rb
0 → 100644
View file @
d213fe83
# BySemester contains logic for setting the current request's Semester.
module
BySemester
extend
ActiveSupport
::
Concern
included
do
before_action
:set_semester
end
# This page needs to know what semester it should load data from.
# 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
])
session
[
:semester_id
]
=
@semester
.
id
elsif
session
[
:semester_id
].
nil?
@semester
=
Semester
.
first
session
[
:semester_id
]
=
@semester
.
id
else
@semester
=
Semester
.
find_by_id
(
session
[
:semester_id
])
end
end
end
schedules/app/controllers/course_sections_controller.rb
0 → 100644
View file @
d213fe83
class
CourseSectionsController
<
ApplicationController
def
show
@section
=
CourseSection
.
find_by_id
(
params
[
:id
])
end
end
Prev
1
2
3
4
5
Next
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